I agree with Anthony's proposal, in a form these callbacks should be
handled as validations are handled. By doing that, the user will return to
the same form he/she filled.
For a simple error message response.flash can be used. For more "in-form"
messages, from my point of view, we should find a simple way to place the
error_message just 'ones', otherwise we have to add a parameter in all
different forms (grid, smartgrid, sqlform etc).


 Paolo

2014-08-18 22:36 GMT+02:00 Anthony <abasta...@gmail.com>:

> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/BB32aGzGtuQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to