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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -