Opened 13 years ago
Closed 12 years ago
#18102 closed Cleanup/optimization (fixed)
fr localflavor : force min and max length
Reported by: | mothsART | Owned by: | nobody |
---|---|---|---|
Component: | contrib.localflavor | Version: | 1.3 |
Severity: | Normal | Keywords: | fr localflavor |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
on fr localflavor, i think the best way is to force min and max length on form field.
Attachments (1)
Change History (6)
by , 13 years ago
Attachment: | Django-1.3.1_localflavor_forms.patch added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Correct me if I'm wrong but I think setting the max_length
option adds an html maxlength
attribute to the field which might be interesting but specifying min_length
doesn't add anything useful here.
comment:3 by , 13 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
No Simon, you are not wrong. So let's accept it on the base that max_length might be useful for constructing the widget.
comment:4 by , 13 years ago
charettes (Simon) : html5 minLength provides the input argument.
While Django does used it yet, i feel good to make explicit...not necessarily required.
In my patch, i think the key element is to use CharField instead of Field for at least benefit from "max" and "min_length".
Ergonomically, I think that a user always prefers a frame imposed as a false freedom.
In our case, if the validator strength size, why would it be possible to have a longer field?
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Why do you think it would be better? The validators for these fields already enforce the length.