Opened 13 years ago

Closed 12 years ago

#11701 closed (fixed)

[patch] DateInput widget: allow uggettext_lazy in format attr

Reported by: carsten Owned by: nobody
Component: Forms Version: 1.1
Severity: Keywords:
Cc: carsten.kraus@…, hr.bjarni+django@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently the following raises "TemplateSyntaxError 'strftime() argument 1 must be string or
read-only buffer, not __ proxy__ ":

some_date = fields.DateField(widget=widgets.DateInput(format=ugettext_lazy('%d.%m.%Y'))) 

The attached patch fixes DateWidget by using force_unicode() on self.format in the date.strftime() method.

Attachments (1)

dateinput_ugettext_enabled.diff (506 bytes) - added by carsten 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by carsten

comment:1 Changed 13 years ago by hejsan

Cc: hr.bjarni+django@… added

comment:2 Changed 12 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

Fixed in [12029]

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