On Thu, Apr 23, 2009 at 6:55 PM, Gary <[email protected]> wrote:
>
> This seems so elementary, but it's been bugging me for days. I tried
> to find more information in the documentation, in the book, searched
> this group and even read the source (as best I could), but I'm
> stymied.
>
> When I use the function:
>
> http://localhost:8001/myapp/default/data/update/person/1
>
> the form is displayed as expected, but after the update, the resulting
> screen is (redirected to):
>
> http://localhost:8001/myapp/default/data/tables
>
> and I cannot figure out how to change that behavior, for example call
> index.
>
> Am I missing something fundamentally simple? Also, what is the best
> way to modify the SQLForm that is used in the display. Is there a
> better description on how to use the CRUD functions?
By default, web2py have in gluon/tools.py, class Crud:
self.settings.create_next = URL(r=request)
self.settings.update_next = URL(r=request)
self.settings.delete_next = URL(r=request)
So, if you have:
mycrud = Crud(globals(), db)
you can change URLs with:
mycrud.settings.create_next = URL(r=request, f='myfunction', args='...')
Same for update_next and delete_next.
--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---