SqlAlchemy: get object instance state -


this: intro object states lists 4 permutations of presence-in-db/presence-in-session:

transient, pending, persistent & detached 

is there way of querying given object return of 4 states object in?

i tried rooting around in _sa_instance_state couldn't find relevant.

thanks!

better use inspection api:

from sqlalchemy import inspect state = inspect(obj)  # booleans state.transient state.pending state.detached state.persistent 

Comments

Popular posts from this blog

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -