[sqlalchemy] Storing data on an instance that's deleted when the object is expired

2015-09-25 Thread Adrian
For some methods/properties on a model it might be useful to memoize its result. There are some common decoratos such as cached_property from werkzeug which simply add the value to the object's __dict__ after retrieving it the first time (thus not calling the property's getter again). Or you

Re: [sqlalchemy] Storing data on an instance that's deleted when the object is expired

2015-09-25 Thread Mike Bayer
On 9/25/15 8:22 AM, Adrian wrote: For some methods/properties on a model it might be useful to memoize its result. There are some common decoratos such as cached_property from werkzeug which simply add the value to the object's __dict__ after retrieving it the first time (thus not calling