Part of lp.app.utilities.celebrities View In Hierarchy
Known subclasses: lp.app.utilities.celebrities.LanguageCelebrityDescriptor, lp.app.utilities.celebrities.PersonCelebrityDescriptor
This descriptor removes unnecessary boilerplate from the LaunchpadCelebrities attribute, as well as optimizing database access to ensure that using a celebrity causes at most one database query per request.
TODO: By implementing a suitably clever wrapper, we should be able to reduce the queries further, as we will only ever need to really query the database if code attempts to access attributes of the celebrity besides the non-volatile id and name attributes. However, this is non trivial as we need to ensure that security and interface declarations remain unchanged. Perhaps we need a way of instantiating SQLObject instances in a 'lazy' mode? Or perhaps we should not worry about volatile attribute changes and pass a selectResults value through to the SQLObject.get method, which should allow us to instantiate a real instance without hitting the database. -- StuartBishop 20060123
Method | __init__ | Interface is used to lookup a utility which must have both |
Method | __get__ | Undocumented |
Method | _getCelebrityByName | Find the celebrity by name. |
Method | _isRightCelebrity | Is this the celebrity we were looking for? |