Well, there is an error_dict passed when raising Invalid but it's
obviously ignored, that's why I can't simply reimplement it just
adding the error_dict variable...
thanks,
Matej
the part of source code:
raise Invalid(_('You must give a value for %s') % self.required,
value_dict, state,
error_dict={self.required:
Invalid(self.message('empty', state), value_dict,
state)})
On Jun 28, 10:20 am, "Diez B. Roggisch" <[email protected]> wrote:
> Am 28.06.2010 um 10:07 schrieb mte:
>
> > Hi,
> > If I use the RequireIfMissing validator I only get e.g. {'_the_form':
> > 'You must give a value for full_name'} instead of something like
> > {'full_name': 'You must give a value'} in tmpl_context.form_errors.
>
> > The difference is that in first case I can't mark and style the empty
> > field which needs to be not empty. Any idea how to fix this?
>
> I'd say it's a bug in formencode.
>
> The problem is that chained validators must set an error-dict if they
> want to set individual field errors. Obviously this isn't happening. I
> suggest you take the implementation of RequireIfMissing, and re-
> implement it, then propose a patch to formencode.
>
> 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.