Ok, now I got it.
But, I dont think DAL has a method for doing that.
I know just "notnull", "unique" and "ondelete" that are enforced at the
level of the database.
I think you should use raw SQL for that
db.executesql('ALTER TABLE......;)
2010/8/27 Adrian Klaver <[email protected]>
> On Friday 27 August 2010 4:15:17 pm Bruno Rocha wrote:
> > I dont know if I understand clearly what you want, but..
> >
> >
> > May be :
> >
> > def get_sql_date():
> > return db.executesql('select CURRENT_DATE')
> >
> >
> Field('grade_date','date',compute=get_sql_date,required=True,notnull=True)
> >
> > or
> >
> >
> Field('grade_date','date',default=request.now.date().strftime('%Y-%m-%d'),r
> >equired=True,notnull=True)
> >
> >
>
> Thanks but that attacks the problem from the client end of things, not the
> database. What I am looking for is a way to supply database specific
> variables
> to the table creation process. I would like to end up with the field in the
> database having the definition:
>
> grade_date DATE NOT NULL DEFAULT CURRENT_DATE
>
> This would make the DEFAULT have meaning outside of the framework.
>
>
>
> --
> Adrian Klaver
> [email protected]
>
--
http://rochacbruno.com.br