This should work. Which version? If you have the bug with the latest version please open a ticket in google code.
On Dec 27, 2:55 am, JF <jf_sic...@hotmail.com> wrote: > Have another issue. It seems the datetime in my archive will always be the > datetime of creation of the initial record, not the updates. > > Here is a glimpse of the Model: > --------------------------------------------------------------------------- > --------------- > db.define_table('part', > Field('iditm', db.item), > Field('idbsn', db.business), > Field('mpn', 'string'), > Field('created_on', 'datetime', default=request.now, > update=request.now, readable=False, writable=False), > Field('created_by', db.auth_user, default=auth.user_id, readable=False, > writable=False)) > > db.define_table('part_archive', > Field('current_record', db.part), db.part) > --------------------------------------------------------------------------- > --------------- > > And here is a glimpse of the Controller: > > --------------------------------------------------------------------------- > --------------- > @auth.requires_login() > def edit(): > "edit an existing mpn page" > thispage = db.part[request.args(0)] > if not thispage: > redirect(URL(r=request, f='index')) > > form = crud.update(db.part, thispage, onaccept=auth.archive, > next = URL(r=request, f='edit', args=request.args), > deletable = False) > archive = db(db.part_archive.current_record==thispage.id).select() > return dict(form=form, thispage=thispage, archive=archive) > > --------------------------------------------------------------------------- > --------------- > > I thought the "update=request.now" in the Model would update the Field > 'created_on'. > > What would be a good way to update this field whenever the Record is > updated? I want to archive the datetime a table is updated. > > Thanks, > > JF