On Dec 14, 2006, at 6:21 PM, Steve Bergman wrote:
> > > Alberto Valverde wrote: >> On Dec 13, 2006, at 10:51 PM, Steve Bergman wrote: >> >>> >>> I thought that might be the case and put in a: >>> >>> print >>sys.stderr, tg_errors >>> >>> and it printed exactly once and it was None. >>> >>> Also, if I use a validator that actually would fail, like Empty >>> (), it >>> correctly puts up a validation message when it redisplays the form. >>> >>> I'll look for that thread. >> >> Hmmm, can you send me privately a simple quickstarted app (or , >> better, a test case if possible) that reproduces the problem so I can >> check it out? >> > > Well, you were correct. I found the thread (and related howto): > > http://docs.turbogears.org/1.0/UnifiedControllers > > and have things working. Though I would hope that in 2.0 it would be > less of a gotcha. > > I understand now why my controller was only running once. And I guess > the validation (of nothing) was failing in a way that left tg_errors > set to None? Yep. After skimming the source I guess that validation was not failing, however, the validate decorator sets cherrypy.request.input_values and cp.req.validation_errors. When those attributes are set the widget logic for picking up value and errors thinks that the form is being redisplayed so it ignores the value you send it. Hmmm, I'm going to take a look a it to see if it can be fixed without creating havoc.... ;) Thanks, Alberto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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?hl=en -~----------~----~----~----~------~----~------~--~---

