Oleg Broytmann, el 16 de abril a las 22:39 me escribiste:
> On Mon, Apr 16, 2007 at 01:26:43PM -0300, Leandro Lucarella wrote:
> > Just a thought: what about adding a 'filters' to any "blob-like" column?
> 
> class GzipFilter(validators.Validator):
>    def from_python(self, value, state):
>       return compress(value)
> 
>    def to_python(self, value, state):
>       return decompress(value)
> 
> class MyTable(SQLObject):
>    bob = PickleCol(validator=GzipFilter())

There you go, this is great! =)

I didn't know you can add validators to a Column this way...

-- 
LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation
------------------------------------------------------------------------
E-Mail / JID:     [EMAIL PROTECTED]
GPG Fingerprint:  D9E1 4545 0F4B 7928 E82C  375D 4B02 0FE0 B08B 4FB2 
GPG Key:          gpg --keyserver pks.lugmen.org.ar --recv-keys B08B4FB2
------------------------------------------------------------------------
Please could you stop the noise, I'm trying to get some rest
>From all the unborn chicken voices in my head
What's that...? (I may be paranoid, but not an android)


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to