Opened 17 years ago

Closed 17 years ago

#5728 closed (duplicate)

SelectDateWidget does not work with datetime.date

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

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 by Matt McClanahan, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicated by #5917, which has patches.

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