Hello,
here is a patch that should correct the problem with validators. In fact
the method _SO_setValues does the job correctly so I just copy its
code to set():
--- /home/cyril/src/SQLObject/sqlobject/main.py Tue Aug 31 10:49:27 2004
+++ main.py Thu Sep 2 18:26:55 2004
@@ -760,10 +760,14 @@
for name, value in kw.items():
fromPython = getattr(self, '_SO_fromPython_%s' % name,
None)
if fromPython:
- value = fromPython(value, self._SO_validatorState)
- toUpdate[name] = value
+ dbValue = fromPython(value, self._SO_validatorState)
+ else:
+ dbValue = value
+
+ toUpdate[name] = dbValue
if self._cacheValues:
- setattr(self, instanceName(name), value)
+ setattr(self, instanceName(name), value)
+
for name, value in extra.items():
setattr(self, name, value)
Cyril Elkaim
|