[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-21 Thread Anthony
Neither of those has anything to do with any GET vars. request.get_vars.id represents an "id" variable passed in the query string of the URL. On Monday, April 21, 2014 12:19:56 PM UTC-4, Sharon Correll wrote: > > Yes, using request.get_vars.id solved that problem. And it turns out that > I was c

[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-21 Thread Sharon Correll
Yes, using request.get_vars.id solved that problem. And it turns out that I was confusing it by using different form-names, so the modification is now happening as expected! Hurray, thanks for your help. Just to clarify, when I I look at the HTML I see: ... The ID 12 is in there

[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-21 Thread Anthony
When you say you are using request.vars.id, do you mean you have an "id" variable in the query string, as in /myform?id=1? If so, change the name of that variable to something else, as the edit form will include its own hidden field with the name "id" -- so upon submission, there will be a requ

[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-21 Thread Sharon Correll
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

[web2py] Re: SQLFORM inserts new record instead of updating existing record

2014-04-19 Thread Anthony
You should not call form.process twice. Does idToEdit come from a URL arg or var? Maybe something like this: def myform(): record = db.langResource(request.args(0)) form = SQLFORM(db.langResource, record=record).process( message_onsuccess='Resource modified' if record else 'New re