Opened 7 years ago

Closed 6 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


on fr localflavor, i think the best way is to force min and max length on form field.

Attachments (1)

Django-1.3.1_localflavor_forms.patch (1.5 KB) - added by mothsART 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by mothsART

comment:1 Changed 7 years ago by Claude Paroz

Why do you think it would be better? The validators for these fields already enforce the length.

comment:2 Changed 7 years ago by Simon Charette

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 Changed 7 years ago by Claude Paroz

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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 Changed 7 years ago by mothsART

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 Changed 6 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In [47da7b7a9aefce66fa2c54833b5ba308781fc95e]:

Fixed #18102 -- Defined min/max_length on French localflavor form fields

Thanks mothsART for the report and the initial patch.

Note: See TracTickets for help on using tickets.
Back to Top