Oleg Broytmann wrote:
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.
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:
{'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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss