Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of SQLObjectAutoUpdateField


Ignore:
Timestamp:
04/23/06 19:00:10 (13 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SQLObjectAutoUpdateField

    v3 v4  
    3232This will update the Modified field every time an assignment is made on any of the other fields (actually, including the Modified field, but doing that would be silly). In place of self.sqlmeta.columns.keys(), you could use a list of the field names you want to catch and update the Modified field for. 
    3333 
    34 ''-AcidReign'' 
     34''-Sean Jamieson (AcidReign)'' 
    3535 
    3636This is a good recipe, exactly what I needed... but I had to modify is a bit to get it to work properly.  I don't know if this is because of changes to SQLObject or what.  What I found was that, in the case of the example above, when __setattr__ is called, for example, for the 'Body' column, what is actually passed as the name to __setattr__ is '_SO_val_Body'.  However, what's in the list of keys is 'Body'.  So my fix was as follows: