Ticket #6112: selectdate_right.diff

File selectdate_right.diff, 776 bytes (added by anonymous, 17 years ago)
  • django/newforms/extras/widgets.py

     
    77from django.newforms.widgets import Widget, Select
    88from django.utils.dates import MONTHS
    99from django.utils.safestring import mark_safe
     10from django.utils.encoding import force_unicode
    1011
    1112__all__ = ('SelectDateWidget',)
    1213
     
    3132            self.years = range(this_year, this_year+10)
    3233
    3334    def render(self, name, value, attrs=None):
     35        value = force_unicode(value)
    3436        try:
    3537            value = datetime.date(*map(int, value.split('-')))
    3638            year_val, month_val, day_val = value.year, value.month, value.day
Back to Top