request.args[0] fails if there is no request.args. request.args(i) never fails returns None instead. If you pass None as second argument to crud.update it behaves as crud.create. ;-)
On Jan 28, 2:33 pm, weheh <[email protected]> wrote: > Massimo, I don't see how that could possibly work if there's no > request.args(0)? In fact, I tried it and got an "invalid function" > error. Wouldn't I first have to test not len(request.args(0)) and if > True then create else update? This seems obvious, but it seems that > crud is so compact that it might already be testing that condition, > no? > > On Jan 28, 10:02 am, mdipierro <[email protected]> wrote: > > > form = crud.update(db.person, request.args(0), ...) > > > this will do an update if you havehttp://.../action/[id] and a create > > ifhttp://.../action > > > On Jan 28, 1:53 am, weheh <[email protected]> wrote: > > > > changing subject line- Hide quoted text - > > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

