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)

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

Download all attachments as: .zip

Change History (6)

by mothsART, 13 years ago

comment:1 by Claude Paroz, 13 years ago

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

comment:2 by Simon Charette, 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 Claude Paroz, 13 years ago

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 by mothsART, 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 Claude Paroz <claude@…>, 12 years ago

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