grid uses args to determine the operation it's doing (and also keeping track of the selected records, etc etc etc) Check the docs for using the "args" parameter in the docs.
http://web2py.com/books/default/chapter/29/07#SQLFORM.grid-and-SQLFORM.smartgrid On Wednesday, February 13, 2013 2:42:03 PM UTC+1, heytsecity wrote: > > > I'm developing a newsletter system. Now I would like to create a grid that > shows newsitems which are connected to a specific newsletter. > > I got this: > > controllers/nieuwsbrief.py > def manageNewsitem(): > items = (db.newsletter_items.newsletter == request.args(0)) > grid = SQLFORM.grid(items) > return dict(grid=grid) > > Now when i go to *nieuwsbrief/manageNewsitem/1*, for some reason it > redirects me to a page with an empty grid, showing "no records found" > > But when I hard-code it like this.. > > def manageNewsitem(): > items = (db.newsletter_items.newsletter == 1) > grid = SQLFORM.grid(items) > return dict(grid=grid) > > ..and go to *niewsbrief/manageNewsitem*, It shows a grid with the items > connected to the newsletter with ID 1 (like how it's supposed to happen) > > Can anyone help me out with this? > -- --- 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/groups/opt_out.

