I do not understand. If the saved_on value is not generated when the form is saved, when is it generated? How is it passed to the form? setting it in onvalidation is ok, but the problem is whether it can be tampered with.
On Sep 30, 1:48 pm, Manu <[email protected]> wrote: > Ok i have tried the default argument , but the issue is that the form > is going to be generated with the saved_on value already set instead > of generating the value if the submited values are stored and > validated. I have seen in the doc that we could use onvalidation , is > that the right way to do it ( onvalidation is going to set the correct > value for this saved_on field )? > > On Thu, Sep 30, 2010 at 8:16 PM, mdipierro <[email protected]> wrote: > > 'date' is not a valid field name and it may cause trouble. Let's use > > saved_on > > > you can do > > > db.define_table('test', > > Field('message'), > > > Field('saved_on','datetime',default=request.now,writable=False,readable=False), > > ) > > > and then you can use > > > form = crud.create(db.test) > > > On Sep 30, 12:00 pm, Manu <[email protected]> wrote: > >> Hi > >> I need some help with a simple thing , > >> My DB is defined this way : > > >> db.define_table('test', > >> Field('message'), > >> Field('date',datetime), > >> ) > > >> I would like to ensure that when the form is created with form = > >> crud.create('test') , that when i submit my form the timestamp is > >> updated with the insert time not the generated one at crud.create time > >> ( we can have minutes between these two ). > > >> Thx > >

