Opened 17 years ago
Closed 16 years ago
#9979 closed (fixed)
localizing input_formats on DateField
| Reported by: | matehat | Owned by: | matehat |
|---|---|---|---|
| Component: | Forms | Version: | 1.0 |
| Severity: | Keywords: | ||
| Cc: | mathieu.damours@… | Triage Stage: | Design decision needed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I needed a DateField to be able to receive lazy ugettext objects and resolve them at validating time, but when I tried I got an error from the internal python date parser, so I just applied force_unicode on each passed format in the field's clean method and everything works fine. I attached the patch so you can check it out and merge it ASAP!
Currently, my modifications allows the input_formats parameter to be in the form of:
input_formats = ( _l('some_format'), _('some_other_format') ) # where _l is ugettext_lazy
Attachments (1)
Change History (4)
by , 17 years ago
| Attachment: | fields.diff added |
|---|
comment:1 by , 17 years ago
| Cc: | added |
|---|
comment:2 by , 17 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
comment:3 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Patch for the django/forms/fields.py file