I'm following another example in the manual using SQLFORM. The code works as advertised. The only fly in the ointment is when form.errors is True, the user's entry form no longer displays her original values. I'm assuming there's a simple way to pass the request vars back into form at line 11 before return.
1 def diag_form(): 2 if len(request.args): 3 records = db(db.socdiag.id==request.args[0]).select() 4 if len(request.args) and len(records): 5 form = SQLFORM(db.socdiag, records[0], deletable=True) 6 else: 7 form = SQLFORM(db.socdiag) 8 if form.accepts(request.vars, session): 9 response.flash = 'form accepted' 10 elif form.errors: 11 response.flash = 'form has errors' 12 return dict(form=form) Jeff Bauer Rubicon, Inc.
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.