If I create an object, then save() it, potentially the object won't be
actually persisted until sqlalchemy decides that it needs to (for
example on flush/commit, or when some query involving Thing's table gets
executed) which is good. But (in my opinion) the lazyness is a bit too
lazy when it comes to autogenerated primary keys:
t = Something('foo')
session.save(t)
assert t.id is None
but if I then:
session.flush()
assert t.id is not None
My thought is that sqlalchemy should force the object to be flushed (or
whatever must be done to determine the ID, possibly just selecting the
next value from a sequence) when the id property is retrieved.
Thoughts?
-Adam Batkin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---