I think you are mixing concepts.... you cannot return something from
process().accepted, you need to return at the end of your "tracer_form()"
function, is the function who returns things. In the proccess().accepted
you can do some operations, and modify variables that will be later
returned by the function (like response.flash)
I would do this:
{{extend 'layout.html'}}
<h4><center>Tracking</center></h4>
{{=form}}
{{=grid}}
{{=BEAUTIFY(request.vars)}} <h4> <a href = "
http://127.0.0.1:8000/WnD/default/show_form">Show Records</a> -- this is a
link to show_form()
</h4>
def tracker_form():
record = db.content(request.args(0))
show_record = request.args(0)
form = SQLFORM(db.content, record)
grid = None
if form.process().accepted:
response.flash = 'Submitted Successfully!'
response.view = 'http://127.0.0.1:8000/WnD/default/show_form'
#show_form function here!
grid=SQLFORM.grid(db.content)
elif form.errors:
response.flash = 'Form is not correct'
else:
response.flash = 'Please fill out the damn form'
return dict(form=form, grid = grid)
def show_form(results):
return dict(grid=SQLFORM.grid(db.content))
This is if you want to hide the grid in the beggining and show it only
after submission. If you want to show the grid from the beggining just move
the line of grid = SQLFORM(...) where grid= None
--
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.