Hi Anthony,
Thanks for your answer.
I used the form.vars.id way.
And indeed, I had to change my process because the form.process().acceptedwas
false after doing a
form.validate().
So I changed the form.validate() with form.process().accepted and delete
the inserted post if an exception is rais
You have two options -- you can let the .process() method handle the
insert, in which case the record id will be in form.vars.id after that, or
you can do the insert manually, in which case the id will be returned by
the .insert() method (i.e., id = db.post.insert(**dict(form.vars))).
Note, I d
Thanks for your prompt response.
Best Regards,
Thomas
Sent from Android
On Dec 23, 2011 5:02 PM, "lyn2py" wrote:
> Use form.vars.id to get the id of the new record inserted
>
> More about it here:
> http://web2py.com/books/default/chapter/29/7#SQLFORM
> (search form.vars.id to get to the parag
Use form.vars.id to get the id of the new record inserted
More about it here:
http://web2py.com/books/default/chapter/29/7#SQLFORM
(search form.vars.id to get to the paragraph concerned)
On Dec 23, 3:01 pm, Thomas Dall'Agnese
wrote:
> Hi,
>
> Let say I have 2 tables:
>
> db.define_table('post',
4 matches
Mail list logo