have a look in gluon/dal.py to see the internals. Very convenient.

On Tue, May 3, 2011 at 11:30 PM, Jose <[email protected]> wrote:

>
>
> On 3 mayo, 00:21, Massimo Di Pierro <[email protected]>
> wrote:
> > You can easily make a custom type to do that:
> >
> > import xlib
> > compressed =
> > SQLCustomType(
> >             type
> > ='text',
> >             native
> > ='text',
> >             encoder =(lambda x: zlib.compress(x or
> > '')),
> >             decoder = (lambda x: zlib.decompress(x))
> >             )
> >
> > db.define_table(
> >
> > 'example',
> >             Field('data',
> > type=compressed)
> >             )
> >
> > May need some testing. Let us know.
> >
>
> How interesting!
> Where I can read some about SQLCustomType?
>
> Anyone use them? In which case?
>
> Jose

Reply via email to