On Fri, Feb 11, 2011 at 10:30 PM, Massimo Di Pierro <
[email protected]> wrote:
> import datetime
> now=datetime.date.today()
>
>
> db=DAL('mysql://cookbook:[email protected]/cookbook')
>
> db.define_table('category',
> Field('name',length=32,notnull=True,unique=True),
> format='%(name)s')
>
> db.define_table('recipe',
> Field('title',length=32,nutnull=True),
> Field('description',length=256,notnull=True),
> Field('category',db.category),
> Field('pub_date','date',default=now),
> Field('instructions','text'))
>
> # Notice no validators needed!
>
thanks so much. this worked for me :)