I had a similar needs with generating diffs for tracking revision history a 
while back

I ended up pushing everything into a mixin class.  It worked a little like 
this...

    class MutatedChecknObject(object):

        def generate_diff(self):
            insp = sqlalchemy_inspect(self)
            rval = {}
            for c in 
sqlalchemy_orm.class_mapper(self.__class__).mapped_table.c  :
                h = getattr( insp.attrs , c ).history
                if h[1]:
                    continue
                rval[c] = h[0][0]
            return rval
 


-- 
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/groups/opt_out.

Reply via email to