#849: [PATCH] error info messages within a form
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: FastData | Version: 0.9a5
Severity: normal | Resolution:
Keywords: |
----------------------------------+-----------------------------------------
Comment (by alberto):
When validate() validates a form (implicitly with the tg_errors kw
argument as you're suggesting or explicitly by decorating the method with
validate) it places a dict with the unpacked FE.Invalid expception at
cherrypy.request.validation_errors.
If you then branch execution (or let @error_handler() do it) from the
method receiving the data to the one that submitted the form, then errors
*and* previous input will get displayed magically at the form. No need to
hack on the help_text attribute which, who knows, might get used in the
future ;) Just make sure you branch to the other method, do *not* use HTTP
redirects as that request data will then vanish.
This will also ensure that validation_errors get passed in a thread-safe
way (through cp.request) without extra hassle.
The functionallity you're trying to implement is very useful indeed, but
it would be better to use TG's existing mechanisms for doing things as it
could also serve as documentation IMO. I'm afraid, however, that FastData
got a little bit outdated in this respect... :(
HTH,
Alberto
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/849>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---