how to use a special method to lookup a field just in the web service?

Asked by Robert Collins

In Launchpad, BugAttachment.message needs to be an IIndexedMessage, which cannot be served by the regular model class (the DB returns IMessage); it needs to be IIndexedMessage to generate the canonical url efficiently (https://bugs.edge.launchpad.net/malone/+bug/618849).

is there any way to say 'in the webservice, when looking up the message attribute, call function XYZ instead'? That would let the regular message attribute stay as it was rather than being called _message and having a property to access it. (I'll attach the MP showing how I did this in a minute).

Question information

Language:
English Edit question
Status:
Expired
For:
lazr.restful Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Collins (lifeless) said :
#1

https://code.edge.launchpad.net/~lifeless/launchpad/bug-618849/+merge/34011 is the MP showing where I would have loved to be able to do something nifty here.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.