[SQLObject] Validators and Pickle Columns
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Tom C. <su...@ic...> - 2010-07-30 05:33:15
|
Hi all, I would like to use a validator with a PickleCol like this: ---------------- cut --------------------------------------------------------- from formencode import validators class PTValidator(validators.FancyValidator): def validate_python(self, value, state): # Do validation on value here before storing it in the db print "value:", value class PT(SQLObject): pickled = PickleCol(validator=PTValidator) ---------------- cut --------------------------------------------------------- The problem is that (it seems) value is already pickled by the time it is passed to the PTValidator.validate_pyton() method. Can anyone give me some example/advise on how to use validators on a pickle column and being able to **validate** the value being stored only, but still leaving SQLObject to deal with the pickling/unpickling? Thanks, Tom |