I changed it to look very similar to this:

> def myform():
>     record = db.langResource(request.args(0))
>     form = SQLFORM(db.langResource, record=record).process(
>         message_onsuccess='Resource modified' if record else 'New 
> resource added')
>     return dict(form=form)
>
>>
except that I get the id variable using "request.vars.id", and I include 
the id variable in the dictionary:

    idToEdit = request.vars.id
    recToEdit = db.langResource(idToEdit)
    form = SQLFORM(db.langResource, record=recToEdit).process(
        message_onsuccess='Resource modified' if recToEdit else 'New 
resource added')
    return dict(sqlForm=form, idToEdit=idToEdit)

Now when I submit the form, this variable comes back as a list. So if 
originally the id was 6, after I press Submit it is ['6', '6'] (two 
strings). This was not happening before. And not surprisingly, submitting 
the form has no effect at all.

It makes sense to be sure to just call the process() function once, but 
when I reorganized my original code that way, I'm still getting the 
original behavior (a new record is created and the old one is not modified).

-- 
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.

Reply via email to