[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Anthony
Well, I suppose there is no myform object. If you want to pass the id of the record that was inserted by *this* form, you can do: URL('album', args=request.args(0,cast=int), vars=dict(id='[id]')) You can pass any variable from the form in the "next" URL that way. It will automatically replace

[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Mark Billion
When I put that in, I get " global name 'myform' is not defined"...thoughts? On Tuesday, May 6, 2014 10:01:13 AM UTC-4, Anthony wrote: > > If you want to include the id in the query string (i.e., ?id=1), then you > have to use the "vars" argument to URL() and give it a dictionary: > > URL('album

[web2py] Re: SQL Forms Redirect

2014-05-06 Thread Anthony
If you want to include the id in the query string (i.e., ?id=1), then you have to use the "vars" argument to URL() and give it a dictionary: URL('album', args=[request.args(0,cast=int), vars=dict(id=myform.vars.id)]) Anthony On Tuesday, May 6, 2014 9:13:55 AM UTC-4, Mark Billion wrote: > I hav

[web2py] Re: SQL forms

2011-06-16 Thread Massimo Di Pierro
Look at this lines: if form.accepts(request.vars, session,keepvalues=True): db.events.insert(**db.events._filter_fields(form.vars)) form.accepts does the insert already for you. You do not need the second line. Massimo On Jun 16, 9:25 am, Nils Olofsson wrote: > Hi, > I have this: > > t