On Monday, August 18, 2014 11:55:43 AM UTC-4, Paolo Valleri wrote:
>
> The first issue is that, I don't know a simple way (using sqlform.grid) to
> return to the form even if the validation has passed successfully.
>
Maybe something like:
SQLFORM.grid(..., oncreate=lambda form: redirect(URL(args=request.args, vars
=request.get_vars,
user_signature=True)))
The second is to display the error message.
> Maybe we can add an error_message parameter to _before_* ?
>
The database callbacks are independent of forms, so form error messages
probably don't belong there. Instead, another option would be to have
SQLFORM.accepts check whether the insert/update actually succeeded, and if
not, act as if validation failed (i.e., return False and set form.accepted
to False). We'd still have to figure out how to specify and display an
appropriate error message in that case.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.