From: Oleg B. <ph...@ph...> - 2008-05-14 21:33:09
|
On Wed, May 14, 2008 at 04:21:54PM -0500, Jim Steil wrote: > 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. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |