Re: [sqlalchemy] Formula for determining Transient, Pending, Persistent, Detached

2010-09-01 Thread Michael Bayer
On Sep 1, 2010, at 11:30 AM, Kent wrote: > Please correct me if I'm mistaken and let me know if there is a better > way: > > if attributes.instance_state(instance).has_identity: > instance is Persistent or Detached > > if attributes.instance_state(instance).session_id: > instance is Pending o

[sqlalchemy] Formula for determining Transient, Pending, Persistent, Detached

2010-09-01 Thread Kent
Please correct me if I'm mistaken and let me know if there is a better way: if attributes.instance_state(instance).has_identity: instance is Persistent or Detached if attributes.instance_state(instance).session_id: instance is Pending or Persistent Thanks, Kent -- You received this messag