Hello,
I am trying to figure it out how I may add a button on crud.read form
that redirect if pressed on crud.update form.
I would like my users to be able to modify their seizures mistakes if
they made some...
To not make update to the database if the data are correct I redirect
them to crud.read form before let them confirm or update their data with
crud.update.
Here my controller :
def test():
if auth.has_membership(auth.id_group('gr1')):
form = SQLFORM(db.atable)
elif auth.has_membership(auth.id_group('gr2')):
form = SQLFORM(db.atable,deletable=True)
elif auth.has_membership(auth.id_group('gr3')):
form = crud.create(db.atable)
if form.accepts(request.vars, session):
response.flash = T('form accepted')
form=crud.read(db.atable,form.vars.id) # I don't know how to
create a "update button"
if form: # here I don't know how to verify if the "update
button" is _onclick
form=crud.update(db.atable,form.vars.id)
elif form.errors:
response.flash = T('form has errors')
else:
response.flash = T('please fill out the form')
return dict(form=form)
Thanks
Jonhy