On Fri, Feb 11, 2011 at 10:30 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> import datetime
> now=datetime.date.today()
>
>
> db=DAL('mysql://cookbook:cookb...@127.0.0.1/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 :)

Reply via email to