attribute history features are available via get_history():

http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html?highlight=get_history#sqlalchemy.orm.attributes.get_history

However this history is only active until the next flush.  I doubt it's 
appropriate as a substitute for implementing a GUI feature that illustrates 
pending changes (and possibly even supports "undo") over a span of a whole 
transaction, as flushes generally need to occur at any time before a query 
proceeds; otherwise, you're starting to architect your application around the 
behavior of your persistence system which is a fairly brittle dependency.

My advice would be to build a system that tracks changes as they occur using 
attribute events: 
http://docs.sqlalchemy.org/en/rel_0_8/orm/events.html#sqlalchemy.orm.events.AttributeEvents
  and to link these events to a datastructure that ultimately can be referred 
to by the GUI on a per-field basis (this is essentially the classic "memento" 
pattern, http://en.wikipedia.org/wiki/Memento_pattern).



On Feb 1, 2013, at 1:05 PM, [email protected] wrote:

> No suggestions? 
> 
> On Wednesday, January 30, 2013 1:31:33 PM UTC-7, [email protected] wrote:
> [...]
> How can I determine what [attributes] has been changed, even after 
> a flush?  (Or should I disable autoflushing?)
> 
> How to revert some changes (but not all; for that I 
> would just do a rollback, yes?)
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to