Hello,

When user submit, I redirect him on a read form, but I get in trouble
when for example user has delete a record with update form.

I solve it like this when use SQLFORM() :

        if form.accepts(request.vars, session):
            session.flash = T('form accepted')
            if len(db(db.table1.id ==
form.vars.id).select(db.table1.id)) == 1:
                redirect(URL(r=request,
f='read',args=(request.args(0),form.vars.id)))
            else:
                redirect(URL(r=request,
f='select',args=(request.args(0))))

But I notice that CRUD has delete_next= option... Could it be add to
SQLFORM somehow? Book seems to be silent on this scenario... Should I
use form.accept().accepted. It has a next methode, but I don't think
it allows to manage conditional redirection...

Thanks

Richard

Reply via email to