Re: [sqlalchemy] how to tell if a relationship was loaded or not ?

2014-06-12 Thread Jonathan Vanasco
On Wednesday, June 11, 2014 7:11:35 PM UTC-4, Michael Bayer wrote: > usually we do "key" in obj.__dict__ or "key" in inspect(obj).dict. > wow. i was really over-thinking this! @Ladislav this is for the application logic itself. trying to optimize db access. -- You received this message b

Re: [sqlalchemy] how to tell if a relationship was loaded or not ?

2014-06-12 Thread Ladislav Lenart
Hello. Out of curiosity. Do you want this during (unit) testing or in the application logic itself? Ladislav Lenart On 11.6.2014 20:17, Jonathan Vanasco wrote: > I can't find this in the API or by using `inspect` on an object. > > I'm trying to find out how to tell if a particular relationship

Re: [sqlalchemy] how to tell if a relationship was loaded or not ?

2014-06-11 Thread Mike Bayer
On 6/11/14, 2:17 PM, Jonathan Vanasco wrote: > I can't find this in the API or by using `inspect` on an object. > > I'm trying to find out how to tell if a particular relationship was loaded or not. > > ie, I loaded Foo from the ORM, and want to see if foo.bar was loaded. > > I thought it might ha

[sqlalchemy] how to tell if a relationship was loaded or not ?

2014-06-11 Thread Jonathan Vanasco
I can't find this in the API or by using `inspect` on an object. I'm trying to find out how to tell if a particular relationship was loaded or not. ie, I loaded Foo from the ORM, and want to see if foo.bar was loaded. I thought it might have been the `.attrs[column].state` , which is an Instan