[sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-10 Thread Chris Withers
Hi All, If I have an unmapped object which has had some attributes set on it, what would be the best way to use that object to load a mapped object? I didn't noticed a session.lookup(myobj) method ;-) The specific semantics I'm looking for would be to find the rows, if there's no rows, retur

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-10 Thread Michael Bayer
On Jan 10, 2013, at 3:35 AM, Chris Withers wrote: > Hi All, > > If I have an unmapped object which has had some attributes set on it, what > would be the best way to use that object to load a mapped object? > > I didn't noticed a session.lookup(myobj) method ;-) what is it looking up ?wh

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Chris Withers
On 10/01/2013 23:52, Michael Bayer wrote: On Jan 10, 2013, at 3:35 AM, Chris Withers wrote: Hi All, If I have an unmapped object which has had some attributes set on it, what would be the best way to use that object to load a mapped object? I didn't noticed a session.lookup(myobj) method ;-

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Michael Bayer
On Jan 11, 2013, at 2:17 AM, Chris Withers wrote: > On 10/01/2013 23:52, Michael Bayer wrote: >> >> On Jan 10, 2013, at 3:35 AM, Chris Withers wrote: >> >>> Hi All, >>> >>> If I have an unmapped object which has had some attributes set on it, what >>> would be the best way to use that object

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Chris Withers
On 11/01/2013 15:26, Michael Bayer wrote: what is it looking up ?what's a "myobj" ? An unmapped instance of the mapped class. yeah you don't want to have unmapped instances of mapped classes lying around. Why? They're just objects. It's really handy having domain objects that can exi

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Michael Bayer
On Jan 11, 2013, at 1:37 PM, Chris Withers wrote: > On 11/01/2013 15:26, Michael Bayer wrote: >> what is it looking up ?what's a "myobj" ? >>> >>> An unmapped instance of the mapped class. >> >> yeah you don't want to have unmapped instances of mapped classes lying >> around. > > Wh

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Chris Withers
On 11/01/2013 20:01, Michael Bayer wrote: On Jan 11, 2013, at 1:37 PM, Chris Withers wrote: On 11/01/2013 15:26, Michael Bayer wrote: what is it looking up ?what's a "myobj" ? An unmapped instance of the mapped class. yeah you don't want to have unmapped instances of mapped classes

Re: [sqlalchemy] using an unmapped object to get the mapped object from a session

2013-01-11 Thread Robert Forkel
Transient Am 11.01.2013 22:33 schrieb "Chris Withers" : > On 11/01/2013 20:01, Michael Bayer wrote: > >> >> On Jan 11, 2013, at 1:37 PM, Chris Withers wrote: >> >> On 11/01/2013 15:26, Michael Bayer wrote: >>> what is it looking up ?what's a "myobj" ? >> > > An unmappe