#9787 closed (invalid)
PasswordInput widget's max_length wrong output.
Reported by: | patrick | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
when I use this code:
#forms.py
class TestForm(forms.Form): check_password = forms.CharField(_('Password (verifica)'), widget=forms.PasswordInput)
#template.html
{{ form.as_table }}
I get this output:
<form action="." method="post"> <table> <tr> <td> <label for="id_nick_name">Nickname</label> </td> <td> <input id="id_password" type="password" name="password" maxlength="<django.utils.functional.__proxy__ object at 0x2b5bb4d407d0>" /> </td> </tr> </table>
the part: maxlength="<django.utils.functional.proxy object at 0x2b5bb4d407d0>" seems strange, i don't know hot get the correct ouput.
Note:
See TracTickets
for help on using tickets.
The first positional argument for a
forms.CharField
is the maximum length for the field, see:http://docs.djangoproject.com/en/dev/ref/forms/fields/#charfield
You are passing in
_('Password (verifica)')
. I'm assuming you mean that to be the label, in which case your form should be: