Hello,
We have found the following two problems:
If someone modify a property and then read it back the 'toPython'
validator's method is _not_ called. In our case we are using a
'UnicaodeValidator' to store Unicode strings in UTF8 into a Postgres
database, code follows:
class UnicodeValidator(sqlobject.include.validators.Validator):
def toPython(self, value, state=None):
if value is None:
return None
return unicode(value,"utf8")
def fromPython(self, value, state=None):
if value is None:
return None
return value.encode("utf8")
Reading an object from the database from the first time correctly calls
the validator 'toPython' method , but not after a write. Is somebody
else having this problem? It arises even when disabling the cache. The
'fromPython' method _seems_ to be called every time.
My second concern is with the parsing of the 'query' part in
connectionFromURI; the values are assigned to properties as String and
are not evaluated, for Boolean values (like enableing and disabling the
cache) it ask for problems as setting cache=False always make a True
value. A simple solution is to use eval before assigning the property
inside the code of the method, but it may raise security problems. Again
is somebody else having this problem?
If I do a patch what is the procedure to post it and make it reviewed?
All in all the library is quite impressive and I must thank the author
for his work.
Cyril Elkaim
|