Re: [SQLObject] Log changes to rows

2008-05-14 Thread Oleg Broytmann
On Wed, May 14, 2008 at 05:49:17PM -0500, Jim Steil wrote: > Oleg Broytmann wrote: > > How did you install the listener? Did you call > >events.listen(addListener, Contact, RowCreateSignal) > > > Yes Then inside def addListener(newValues, postFunctions, tableName='', **kw):... newValues

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
Oleg Broytmann wrote: On Wed, May 14, 2008 at 04:46:08PM -0500, Jim Steil wrote: def addListener(newValues, postFunctions, tableName='', **kw): Here is the dict that I get when I check what is in kw: {'signal': , 'sender': 'motion.model.Contact'>} How did you install the

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Oleg Broytmann
On Wed, May 14, 2008 at 04:46:08PM -0500, Jim Steil wrote: > >>def addListener(newValues, postFunctions, tableName='', **kw): > Here is the dict that I get when I check what is in kw: > > {'signal': , 'sender': 'motion.model.Contact'>} How did you install the listener? Did you call events.lis

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
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.ta

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Oleg Broytmann
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 >

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
Oleg Broytmann wrote: On Wed, May 14, 2008 at 03:58:10PM -0500, Jim Steil wrote: Oleg Broytmann wrote: RowCreatedSignal. I was having some issues with the kwargs parm. Instead of returning a dict with the values of my table, it is returning a dict with the class, and the keyfield val

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Oleg Broytmann
On Wed, May 14, 2008 at 03:58:10PM -0500, Jim Steil wrote: > Oleg Broytmann wrote: > >>RowCreatedSignal. I was having some issues with the kwargs parm. > >>Instead of returning a dict with the values of my table, it is returning > >>a dict with the class, and the keyfield value of the new recor

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
Oleg Broytmann wrote: On Wed, May 14, 2008 at 10:37:31AM -0500, Jim Steil wrote: Is there a way in the RowCreatedSignal event to capture the name of the object (table) that is being inserted into? [skip] I've been trying to get my logging working now for the RowCreatedSignal. I was

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Oleg Broytmann
On Wed, May 14, 2008 at 10:37:31AM -0500, Jim Steil wrote: > Is there a way in the RowCreatedSignal event to capture the name of the > object (table) that is being inserted into? [skip] > I've been trying to get my logging working now for the > RowCreatedSignal. I was having some issues with the

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
Oleg Broytmann wrote: On Tue, May 13, 2008 at 10:48:24AM -0500, Jim Steil wrote: Ok, I've gotten my events to work, but now have another newb question that I can't seem to find the answer to. In the update listener I get the kwargs sent in to find which columns have been changed. I can re

Re: [SQLObject] Log changes to rows

2008-05-14 Thread Jim Steil
Oleg Broytmann wrote: On Tue, May 13, 2008 at 10:48:24AM -0500, Jim Steil wrote: Ok, I've gotten my events to work, but now have another newb question that I can't seem to find the answer to. In the update listener I get the kwargs sent in to find which columns have been changed. I can re

Re: [SQLObject] Log changes to rows

2008-05-13 Thread Oleg Broytmann
On Tue, May 13, 2008 at 10:48:24AM -0500, Jim Steil wrote: > Ok, I've gotten my events to work, but now have another newb question > that I can't seem to find the answer to. In the update listener I get > the kwargs sent in to find which columns have been changed. I can > reference them as a d

Re: [SQLObject] Log changes to rows

2008-05-13 Thread Jim Steil
Jim Steil wrote: Oleg Broytmann wrote: On Mon, May 12, 2008 at 12:58:37PM -0500, Jim Steil wrote: Is there an easy way to log CRUD changes to a table? I know that I could do it by overriding all of the update methods Or setup listeners for signals. SQLObject send signals almost on

Re: [SQLObject] Log changes to rows

2008-05-12 Thread Jim Steil
Oleg Broytmann wrote: On Mon, May 12, 2008 at 12:58:37PM -0500, Jim Steil wrote: Is there an easy way to log CRUD changes to a table? I know that I could do it by overriding all of the update methods Or setup listeners for signals. SQLObject send signals almost on every action, and

Re: [SQLObject] Log changes to rows

2008-05-12 Thread Oleg Broytmann
On Mon, May 12, 2008 at 12:58:37PM -0500, Jim Steil wrote: > Is there an easy way to log CRUD changes to a table? I know that I > could do it by overriding all of the update methods Or setup listeners for signals. SQLObject send signals almost on every action, and even allow the listeners to

[SQLObject] Log changes to rows

2008-05-12 Thread Jim Steil
Hi: Is there an easy way to log CRUD changes to a table? I know that I could do it by overriding all of the update methods, but that seems to be not right. Googling for things like 'sqlobject log changes' just bring back references to logging at a lower level. Any pointers would be apprecia