Thank you Niphlod, I had to read your answer twice to fully understand what 
you meant. Now I get it. I appreciate your pointers!

Thank you Stifan for the suggestion. I am deliberately not using that 
because the result is too long, and the uid will be used on html for id and 
other future purposes.



On Wednesday, December 7, 2016 at 6:17:04 AM UTC+8, Niphlod wrote:
>
> web2py forms use postbacks (the submit is directed to the same address 
> that generated it) so the general flow is the following:
>
> - user hits the page
> - the form was not submitted nor accepted nor errored (goes to the last 
> else)
> - user fills the forms and click submit
> - form was submitted: it can be accepted or errored (goes to if 
> form.accepted or if form.errors)
>
> From the moment user submitted the form that errored to the form 
> rightfully compiled there is no shared state.
> If you really need what you're asking (I'm quite sure that your logic may 
> be pleased with e.g. generate a random uid just in the "accepted" branch) 
> you need to alter the logic: persist the need of generating a new uid 
> somewhere, i.e. the session, and then alter the default value for uid 
> accordingly.
> Or just make your own db I/O with e.g. SQLFORM.factory .
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to