Opened 7 years ago

Closed 6 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: UI/UX:


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

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by carsten

comment:1 Changed 7 years ago by hejsan

  • Cc hr.bjarni+django@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [12029]

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