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/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss