Opened 8 years ago

Closed 8 years ago

#5728 closed (duplicate)

SelectDateWidget does not work with datetime.date

Reported by: MikeH Owned by: nobody
Component: Forms Version: master
Severity: Keywords: SelectDateWidget
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If I'm creating a form to update an existing object, I pass in the date from the object. This is a datetime.date but the SelectDateWidget in newforms.extras.widgets expects it to be a string, or else it does not set the values on the select boxes correctly.

I solved the problem by forcing the incoming value to be a string.

Add

value = str(value)

at line 33 of django/newforms/extras/widgets.py (using revision 6468)

Change History (1)

comment:1 Changed 8 years ago by mattmcc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicated by #5917, which has patches.

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