Hi everyone!
I'm trying to automatically build a shallow copy of a SA-mapped
object.. At the moment my function is just:

newobj = src.__class__()
for prop in class_mapper(src.__class__).iterate_properties:
    setattr(newobj, prop.key, getattr(src, prop.key))

but I'm having troubles with lazy relations... Obviously getattr
triggers the lazy loading, but since I don't need their values right
away, I'd like to just copy the "this should be lazy loaded"-state of
the attribute... Is this possible?

Many thanks for your time!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to