Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-19 Thread Paolo Valleri
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 si

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Anthony
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

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Niphlod
well, there's a reason why those are called "database callbacks". Those are the lower-side of things when you need to put a check somewhere. They have nothing to do with forms or grids, and IMHO, they should stay as they are until a proper "resolution" is found for the common issue of multiple p

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Paolo Valleri
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. The second is to display the error message. Maybe we can add an error_message parameter to _before_* ? Paolo 2014-08-18 17:35 GMT+02:00 Anthony : > So,

[web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Anthony
So, you want to add some logic to SQLFORM.accepts so if an insert or update fails after validation passes, the form still reports an error? Would you specify the error message in the call to SQLFORM.accepts? Anthony On Monday, August 18, 2014 11:25:32 AM UTC-4, Paolo Valleri wrote: > > Hi all,