:-)
1) If you have
db.define_table('a',Field('b',length=40))
add you do
db.a.insert(b='bla'*100)
the string gets truncated but if you try to insert something longer
tha 40chars via form you get a validation error. length=512 if not
specified otherwise.
2) now you can do both:
db.define_table('a',Field('b','date',default=datetime.date.today())
db.define_table('a',Field('b','date',default=Expression('CURRENT_DATE',db=db))
The former is the intended way this should be done. With recent
changed to trunk, you should be able to do in the latter way... buy
why? It just results in code that is less portable.
Massimo
On Aug 29, 2:13 pm, Adrian Klaver <[email protected]> wrote:
> On Sunday 29 August 2010 9:18:16 am mdipierro wrote:
>
> > If you specify a ``field.length`` ('string defaults to 512) you get a
> > default validator that will give errors if you try to insert more than
> > ``length`` chars.
>
> > By doing this you write code that is not portable. Why? How is this
> > different in practice than doing ``default=request.now``?
>
> > Massimo
>
> Blame it on not enough coffee, but I seem to be missing what you are getting
> at
> in the above :)
>
> --
> Adrian Klaver
> [email protected]