#18483: HiddenInput validation i18n trouble
-----------------------------------------+--------------------
     Reporter:  Evil Clay <clay.evil@…>  |      Owner:  nobody
         Type:  Cleanup/optimization     |     Status:  new
    Component:  Uncategorized            |    Version:  1.4
     Severity:  Normal                   |   Keywords:
 Triage Stage:  Unreviewed               |  Has patch:  0
Easy pickings:  0                        |      UI/UX:  0
-----------------------------------------+--------------------
 I have a model with ForeignKey filed and an ModelForm where i do set the
 Hidden Input widget for this filed.
 I have these issues with required validation.

 1. if the field is empty i get an validation error that is only partially
 in my language.
 2. The error is printed out as non_field_error when i use form.as_p, but
 its not printed by the form.non_filed_error alone since the behavior is
 inconsistent.

 I have tracked the issue to the module <django.forms.forms> line 152:
 top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for
 e in bf_errors])

 To my (limited) knowledge i cannot solve the i18n by myself an easy way
 (dirty solution would by overriding the BaseForm class).
 as for to second part i understand that this is an attempt to output the
 error somehow as i use form.as_xxx but when using hiddenInput on required
 filed, it is to be expected that i have to output the form myself to
 display the error on the page where i need to display it.
 The best solution to solve both problems would probabbly be to loose the
 line 152.
 Other solution is to loose the (Hidden filed %s part and ignore the
 inconstancy #2.

 only workaround currently is not to use the form.as_xxx methods on an i18n
 project which implies that the line 152 sucks :)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18483>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to