Is there some way to get the pkey from a detached orm instance (id = obj.id)?

Use case: I'm given an orm object of unknown/untrusted source. I don't want to merge it. I just want to get the id so I can load a known good instance from the db. Is it possible to retrieve it while leaving it in its detached state?

Possibly I could iterate over obj.__dict__ and use del obj.attribute and then merge?

Thanks,
Michael

--
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.

Reply via email to