form.vars.update(request.vars)  <-- what I was looking for, thanks.

I also appreciate the simplified code.  The original code posted
was taken from page 193 of the web2py manual.

-Jeff

On 01/09/2010 11:32 PM, mdipierro wrote:
You can simplify your code

def diag_form():
     form = SQLFORM(db.socdiag, request.args(0), deletable=True)
     if form.accepts(request.vars, session):
         response.flash = 'form accepted'
     elif form.errors:
         # (1)
         response.flash = 'form has errors'
     return dict(form=form)

I am not sure what you asked. Try insert in (1)

    form.vars.update(request.vars)

OR

    if form.record: form.vars.update(form.record.as_dict())

OR

    [form.vars[key]=db.socdiag[key].default for key in
db.socdiag.fields]
-- 
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.


Reply via email to