I am also curious about using the postgresql inet type. -Thadeus
On Wed, Dec 23, 2009 at 10:21 AM, mdipierro <mdipie...@cs.depaul.edu> wrote: > SQLCustomType is not documented because I am not promising backward > compatibility for it in the new DAL (The functionality will be there > but the API may change). Anyway here is a docstring example for a > possible definition of type "decimal" (mind that web2py has a type > decimal so you do not need customtype for this): > > decimal = SQLCustomType > ( > type ='double', # as web2py sees it > native ='integer', # as db sees it > encoder =(lambda x: int(float(x) * 100)), # as conversion > is done > decoder = (lambda x: Decimal("0.00") + Decimal(str(float > (x)/100)) ) > ) > > db.define_table > ( > > 'example', > Field('value', > type=decimal) > ) > > > > On Dec 23, 10:16 am, Johann Spies <johann.sp...@gmail.com> wrote: >> OK. Apologies. I forgot I can specify the length. >> >> Do you have documentation on SQLCustomType somewhere. I did quick >> search in your book and could not find any reference to it. >> >> Regards. >> Johann > > -- > > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to web...@googlegroups.com. > To unsubscribe from this group, send email to > web2py+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.