Opened 15 years ago

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

Description

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 15 years ago.

Download all attachments as: .zip

Change History (3)

by carsten, 15 years ago

comment:1 by hejsan, 15 years ago

Cc: hr.bjarni+django@… added

comment:2 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in [12029]

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