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 SqlObjectGotchas


Ignore:
Timestamp:
09/12/06 08:36:42 (13 years ago)
Author:
simonwittber
Comment:

added new gotcha.

Legend:

Unmodified
Added
Removed
Modified
  • SqlObjectGotchas

    v3 v4  
    3131Check the MySQL docs to see what length values will map to MEDIUMBLOB and LARGEBLOB, if you need to be precise. 
    3232 
     33= Using a Column named 'dirty' = 
     34 
     35I've spent the last few hours tackling a confusing problem in 
     36SQLObject, and thought I might post the experience to help other 
     37TurboGear people. 
     38 
     39I have a table, which has a column named 'dirty' of type Boolean. 
     40 
     41Something was mysteriously setting this bit to false. I hunted though 
     42all my code, and could not find any code which was generating the 
     43update statement: 
     44{{{ 
     45    UPDATE xxx SET dirty = ('f') WHERE id = (XXX) 
     46}}} 
     47As it turns out, one cannot use a field named 'dirty' in SQLObject 
     48classes, as it is an internal attribute used by SQLObject. Everytime 
     49SQLObject sets this attribute, (which was now a property) it triggered 
     50a SQL update operation. 
     51 
     52I renamed the field, and the problem went away.