On Thursday, 2 January 2014 11:41:52 UTC-6, Robert Bjornson wrote: > > Hi all, > > I am a newcomer to web2py, and have what I hope is a simple beginner > question. > > I am following the "mywiki" example in the getting started tutorial. In > it, one can display all the documents for a page > using this url: > > *http://127.0.0.1:8000/mywiki/default/documents/1 > <http://127.0.0.1:8000/mywiki/default/documents/1>* > > *The controller for this page creates a SQLFORM.grid, using this code:* > > > > > > *def documents(): """browser, edit all documents attached to a certain > page""" page = db.page(request.args(0,cast=int)) or > redirect(URL('index')) db.document.page_id.default = page.id > <http://page.id> db.document.page_id.writable = False grid = > SQLFORM.grid(db.document.page_id==page.id <http://page.id>,args=[page.id > <http://page.id>]) return dict(page=page, grid=grid)When the page is > rendered by the view, each row in the grid, representing a document, has > three buttons: view, edit, delete.If I look at the action for these buttons > I see that they are refinements of my current url. For example edit > is:http://127.0.0.1:8000/mywiki/default/documents/1/edit/document/1?_signature=75f1c501a80734585179ab4cafd9a8ac90ee7a51 > > <http://127.0.0.1:8000/mywiki/default/documents/1/edit/document/1?_signature=75f1c501a80734585179ab4cafd9a8ac90ee7a51>I > > don't understand how this url is getting dispatched. I would think it > would go to default.py/documents() <http://default.py/documents()>, with an > args list of [1, edit,document, 1], and vars of > {"_signature:75f1c501a80734585179ab4cafd9a8ac90ee7a51}But, I don't see any > code in documents() that would handle this is the appropriate way. * >
You assumption is correct. * SQLFORM.grid handles the code.* > > > * From the page I end up on when I click edit, it seems like it's > dispatching to mywiki/controllers/appadmin.py. I can't figure out why it > gets there.Thanks for your help.Rob * > > > -- 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/groups/opt_out.

