yes, a public api would be awesome, perhaps for a future version? :)

for now, i'll stick to that -- since it works, heh.


cheers,
richard.


On 07/24/2015 12:59 PM, Mike Bayer wrote:


On 7/24/15 10:45 AM, Richard Gerd Kuesters wrote:
>>> obj._sa_instance_state.committed_state.get('key') == obj._sa_instance_state.dict.get('key')
False

is this all that's necessary to track down what's modified and the past state (i believe to be sa_instance_state.dict) ?

I'd prefer you use the public APIs but sure, those are the mechanics of it right now.





cheers,
richard.

On 07/24/2015 11:34 AM, Richard Gerd Kuesters wrote:
will this answer my second question?

>>> obj._sa_instance_state.committed_state
{'batch_status': STARTED(db=1),
 'updated_by': 24769797950537744L,
 'updated_on': <Arrow [2015-07-24T14:02:03.360479-03:00]>}

cheers,
richard.

On 07/24/2015 11:13 AM, Richard Gerd Kuesters wrote:
hi!

first, /yes/, set and after_flush are quite different events :) but here's what i'm trying to accomplish:

one object have an attribute, like 'state', and i would like to monitor and trigger some other methods if (given scenarios):

1. the program sets a new value to a state that is equal to it's actual state (and/or value), i can use 'set' but, does it reflect only the value set or when it gets commited? 1.1. and, if set to the same value, returning the old value (set with retval=True) will make this object dirty (supposed to be the only value modified) ? 2. after_flush, if one of these entity get's modified, can i track down what was modified, including my "state" column if possible?

cheers,
richard.
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

<<attachment: richard.vcf>>

Reply via email to