I am forever having trouble with making the form wizard show all the steps
in one page, all it shows now is the last batch of form questions instead
of the previous batches and although the database gets updated with the
entry, a file that is supposed to be uploaded into the database isn't.
When I view the page, while in the terminal I am able to see all steps 0-8
with fields showing.. but it in the actual page view it just shows only the
last batch of form fields in the last step. Why?
step = 0
for i in STEPS:
if step == 0:
session.myformt = {}
fields=STEPS[i]
print "Fields:" + str(fields) + "Trip Day" + str(step)
if isinstance(fields,tuple):
form = SQLFORM.factory(*[f for f in db.myform if f.name in
fields])
step = step+1
if form.accepts(request,session):
session.myform.update(form.vars)
db.myform.insert(**session.myform)
session.flash='Thanks! Form submitted.'
redirect(URL('myformlist'))
elif form.errors:
response.flash='Please correct errors!'
return dict(form=form)
--
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/d/optout.