whoops, right:
form = SQLFORM(db.table)
if form.process().accepted:
     redirect(URL('whatever', args=form.vars.id))

On Wednesday, September 5, 2012 9:00:10 PM UTC+2, Marin Pranjić wrote:
>
> Should be accepted instead of validate:
>
> form = SQLFORM(...).process()
> if form.accepted:
> ... redirect(URL(..., args=form.vars.id))
>
> On Wed, Sep 5, 2012 at 8:56 PM, Niphlod <nip...@gmail.com <javascript:>>wrote:
>
>> in any case it should be at least form.vars.id. Don't know if it's 
>> available inside the process() environment.
>> Even if it doesn't work, is it so hard to 
>> if form.process().validate:
>>     redirect(URL('whatever', args=form.vars.id))
>>
>> ?
>>
>>
>> On Wednesday, September 5, 2012 8:41:44 PM UTC+2, Philip Kilner wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to wean myself of CRUD and am doing an insert with 
>>> SQLFORM.process().
>>>
>>> I want to redirect on success to view the newly inserted record.
>>>
>>> How can I access the ID of the new record in this context? 
>>>
>>> Hoped I could do something like: -
>>>
>>> SQLFORM(db.t_account).process(**next=URL(c='account',f='index'**, 
>>> args=['t_account', id]))
>>>
>>> --
>>>
>>> Cheers,
>>>
>>> PhilK
>>>
>>>  -- 
>>  
>>  
>>  
>>
>
>

-- 



Reply via email to