Ticket #5027: widgets.diff

File widgets.diff, 592 bytes (added by Rob van der Linde, 17 years ago)

Cast value to a string, in case it was a datetime type

  • widgets.py

    old new class SelectDateWidget(Widget):  
    3232
    3333    def render(self, name, value, attrs=None):
    3434        try:
    35             value = datetime.date(*map(int, value.split('-')))
     35            value = datetime.date(*map(int, str(value).split('-')))
    3636            year_val, month_val, day_val = value.year, value.month, value.day
    3737        except (AttributeError, TypeError, ValueError):
    3838            year_val = month_val = day_val = None
Back to Top