Seth schrieb: > Diez and cd34, > > Thanks! I was having a major mental block on Validators and your > comments helped me to implement the needed code as custom validators. > For future reference, this link was also helpful: > http://formencode.org/Validator.html > > However, there's one last thing I keep banging my head against the > wall over: How do I get the specific field errors to show up next to > the fields like they were before (preferably without hacking my own > form template). I thought I'd be able to pass > error=tmpl_context.form_errors into the form.display() call, but for > some reason it's expecting more than just a simple dict type (I'm > getting AttributeError: 'dict' object has no attribute 'error_dict'). > > I'm sure it's something simple that I'm missing, so I apologize in > advance.
When using chained validators, you need return the error-message properly. Right out of my head I can only say that you need to return raise the Invalid-exception with not a string, but a dictionary as error-message. And the keys of that dict need to match the form-fields. Something along these lines. If that's not working, I try & dig some code out, but that has to wait for work tomorrow. Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

