Ticket #10366: T10366.diff

File T10366.diff, 1.4 KB (added by tangc, 16 years ago)
  • db/models/fields/__init__.py

    diff -r df0e563861bd db/models/fields/__init__.py
    a b  
    6363            max_length=None, unique=False, blank=False, null=False,
    6464            db_index=False, rel=None, default=NOT_PROVIDED, editable=True,
    6565            serialize=True, unique_for_date=None, unique_for_month=None,
    66             unique_for_year=None, choices=None, help_text='', db_column=None,
     66            unique_for_year=None, choices=None, multi_choices=None, help_text='', db_column=None,
    6767            db_tablespace=None, auto_created=False):
     68        self.multi_choices = multi_choices
    6869        self.name = name
    6970        self.verbose_name = verbose_name
    7071        self.primary_key = primary_key
     
    315316            defaults['coerce'] = self.to_python
    316317            if self.null:
    317318                defaults['empty_value'] = None
    318             form_class = forms.TypedChoiceField
     319            if self.multi_choices:
     320                form_class = forms.MultipleChoiceField
     321            else:
     322                form_class = forms.TypedChoiceField
    319323            # Many of the subclass-specific formfield arguments (min_value,
    320324            # max_value) don't apply for choice fields, so be sure to only pass
    321325            # the values that TypedChoiceField will understand.
Back to Top