[sqlalchemy] Re: Reloading attributes on expired objects

2010-04-05 Thread John Huang
Michael, Thanks for the quick response. On Apr 5, 12:39 pm, Michael Bayer mike...@zzzcomputing.com wrote: you can certainly expire specific attributes by passing a list of their names to expire: sess.expire(inst, ['foo', 'bar', 'bat']) in modern versions of SQLAlchemy calling

Re: [sqlalchemy] Re: Reloading attributes on expired objects

2010-04-05 Thread Michael Bayer
John Huang wrote: Now I understand that refresh will cause a reload of all attributes based the primary mapper. However, the reason that I want to use expire instead of refresh is because there may be places in my code where the same object will be expired multiple times before an attribute

Re: [sqlalchemy] Re: Reloading attributes on expired objects

2010-04-05 Thread Michael Bayer
Michael Bayer wrote: John Huang wrote: Now I understand that refresh will cause a reload of all attributes based the primary mapper. However, the reason that I want to use expire instead of refresh is because there may be places in my code where the same object will be expired multiple times

[sqlalchemy] Re: Reloading attributes on expired objects

2010-04-05 Thread John Huang
Thanks for your help and insight, Michael! For now, since my program was using SA 0.3, it only deals with instance-wide expiration, so for now I have just wrapped the AttributeImpl.get method to do a full refresh of the instance if its state is expired. On Apr 5, 3:47 pm, Michael Bayer