Re: [sqlalchemy] DetachedInstanceError when calling __repr__

2011-04-07 Thread Michael Bayer
On Apr 7, 2011, at 9:54 PM, BenH wrote: > Hi, > > I have an objects that when I convert to a string using __repr__ > throws a DetachedInstanceError. If I access any of their members or > test the session (using 'user in Session') everything is fine but if I > check 'self in Session' in __repr__

[sqlalchemy] DetachedInstanceError when calling __repr__

2011-04-07 Thread BenH
Hi, I have an objects that when I convert to a string using __repr__ throws a DetachedInstanceError. If I access any of their members or test the session (using 'user in Session') everything is fine but if I check 'self in Session' in __repr__ the result is False. I can reattach it to the Session