I'm a web2py newbie, so please excuse me if I'm overlooking something 
obvious.

I'm trying to build my own custom form for creating and editing records in 
a database. I'm trying to garner clues from the way SQLFORM does it.

The documentation says:

The hidden field called "_formkey" is a one-time token that web2py uses to 
> prevent double submission of forms. The value of this key is generated when 
> the form is serialized and stored in the session. When the form is 
> submitted this value must match, or elseaccepts returns False without 
> errors as if the form was not submitted at all.


I've dug into the session and found places where these keys appear to be 
stored for the forms. My hypothesis is that after the form is processed, 
the associated _formkey is placed in the session's list to prevent the form 
being processed again.

It seems then that I should be able to generate these myself. But when I 
put my own key in the form, it never seems to be added to the session.

Is it possible there is also some magic that happens when the form is 
generated...?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to