Ticket #3852: newforms_extras_widgets.diff

File newforms_extras_widgets.diff, 688 bytes (added by Jeff Hilyard <jhilyard@…>, 18 years ago)

patch to fix newforms.extras.widgets.SelectDateWidget render() bug

  • widgets.py

     
    3333            value = datetime.date(*map(int, value.split('-')))
    3434            year_val, month_val, day_val = value.year, value.month, value.day
    3535        except (AttributeError, TypeError, ValueError):
    36             year_val = month_val = day_val = None
    37 
     36            if isinstance(value,datetime.date):
     37                year_val, month_val, day_val = value.year, value.month, value.day
     38            else:
     39                year_val = month_val = day_val = None
    3840        output = []
    3941
    4042        month_choices = MONTHS.items()
Back to Top