14 May 23:46
Re: Log changes to rows
From: Jim Steil <jim <at> qlf.com>
Subject: Re: Log changes to rows
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-05-14 21:46:08 GMT
Subject: Re: Log changes to rows
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-05-14 21:46:08 GMT
Oleg Broytmann wrote:
{'signal': <class 'sqlobject.events.RowCreateSignal'>, 'sender': <class 'motion.model.Contact'>}
-Jim
On Wed, May 14, 2008 at 04:21:54PM -0500, Jim Steil wrote:Well, I guess we can leave it at that unless anyone else has anything to add. Here is the dict that I get when I check what is in kw:def addListener(newValues, postFunctions, tableName='', **kw): try: user = identity.current.user.id except: user = None if tableName == '': tableName = kw['sender'].sqlmeta.table cl = ChangeLog(user=user, tableName=tableName, operation='INSERT', columnName='All', beforeImage='', afterImage=str(newValues)) I added the tableName parameter for when I'm adding rows to the special table created for SQLRelatedJoins. When adding rows/removing rows to those tables, I'm manually calling this method to log my changes. This same method is called by the RowCreateSignal event.When it is called by the RowCreateSignal event, there should be 'class' key in the kw, not 'sender'. But I must say I have never used events, so I don't understand fully how they are implemented and used. Oleg.
{'signal': <class 'sqlobject.events.RowCreateSignal'>, 'sender': <class 'motion.model.Contact'>}
-Jim
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ sqlobject-discuss mailing list sqlobject-discuss <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
RSS Feed