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, return None (or raise an exception...), if there's one,
return the mapped object, if there's more than one, raise an exception.
I was going to just write this myself (what's the best way to plug an
extra method on session nowadays, or should I just make it a class
method on a mixin?) but thought I'd ask here first...
...I was also curious as to how I can spot only attributes that have
been passed into the objects constructor, or set on it, to use in the
query while making sure not to use any defaults.
Thanks for all/any help!
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.