Smartgrid: get the ID of the just inserted row

46 views
Skip to first unread message

Serge Bourgeois

unread,
Oct 27, 2015, 6:54:46 AM10/27/15
to web2py-users

When creating a new record with smartgrid, the   the 'onvalidation' function cannot give the form.vars.id is since the record is not created yet.
I understand that the onvalidation para allow to control what happens before the form is accepted, but I confess I couldnt' find a kind of 'after_validation'.
In fact, I'd like to create and insert thumbnails automatically when creating new record. For this, I neew the id of the record, just after creation, as for instance described at the page 145 of the book 'web2py application development cookbook' of Marino Reingart, Pablo Martin Mulone, Massimo Di Pierro, Bruno Cezar Rocha, ... ,in the function ' : make_thumbnail

Thanks in advance for any help!





Vinicius Assef

unread,
Oct 27, 2015, 7:11:23 AM10/27/15
to web2py
Use the `oncreate` argument.


--
Vinicius Assef



--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Serge Bourgeois

unread,
Oct 27, 2015, 10:35:33 AM10/27/15
to web2py-users
Thanks! oncreate is working perfectly!
Reply all
Reply to author
Forward
0 new messages