>
> if form.process(onsuccess=lambda form: onaccept_about_text(form),
> next=session.crud_next).accepted:
>
session.flash='Form accepted'
>
By specifying the "next" argument, you are telling it to do a redirect
after processing -- so, it will redirect when the .process() method is
called and therefore never get to your session.flash assignment. Instead,
you either have to make the session.flash assignment before calling
.process() or within your onsuccess function (which will get called before
the redirect). Also, if you already have a function defined for onsuccess
with the appropriate signature (i.e., the first and only required argument
is the form), there is no need to wrap it in a lambda -- just specify the
function directly.
def onaccept_about_text(form):
del session.name
del session.aboutID
session.flash = 'Form accepted'
def generic_about():
...
form.process(onsuccess=onaccept_about_text, next=session.crud_next)
if form.errors:
...
Anthony
--