This also works SQLFORM.smartgrid(..., onvalidation=crud.archive...

But, I now discover archive never saves the original record.  You can
edit the record and it saves the edits, but it never gets the first
version of it.

This statement from the Official Book"on updating, it stores a copy of
the record (as it was before the update)" is incorrect, at least as
far as smartgrid is concerned.  I haven't tried it with SQLFORM by
itself or with CRUD.

On Dec 27, 9:38 am, Anthony <abasta...@gmail.com> wrote:
> Have you tried:
>
> form = SQLFORM.smartgrid(..., onupdate=auth.archive)
>
> Also, note there is also crud.archive, which is the same as auth.archive.
>
> Anthony
>
>
>
>
>
>
>
> On Tuesday, December 27, 2011 7:22:34 AM UTC-5, Cliff wrote:
>
> > This is some ugly code that makes auth.archive() work with smartgrid:
>
> > if len(request.args) > 3 and request.args[-4] == 'owner' and\
> >        request.args[-3] == 'edit' and request.args[-2]=='owner'\
> >        and form[2].process(onsuccess=auth.archive).accepted:
> >         pass
>
> > Surely there must be a better way.  Any and all hints gratefully
> > accepted.

Reply via email to