On Thursday, September 22, 2016 at 6:45:55 AM UTC-4, Scott Hunter wrote:
> Because I don't need it.  The original call tells me enough to make the 
> modifications I need to do, and then proceeds to build an up-to-date grid, 
> which becomes wasted effort because I'm getting a redirect re-build the 
> page I just built.

The grid code first retrieves the records and then calls the selectable 
callback (which it must do, as the record ids are passed to the callback), 
so if the callback makes any modifications to the records, the resulting 
grid will *not* contain up-to-date data unless the grid is called again 
(hence the redirect). I think the idea is to ensure it works in all cases, 
though I agree it could be made more efficient in some cases.

For now, a workaround is to check for request.post_vars.records, and if 
present, run whatever code you need to, and then delete 
request.post_vars.records and request.post_vars.formname before creating 
the grid (this will prevent the form from being accepted and therefore skip 
the redirect). You could abstract this into a wrapper around the grid.


- 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