diff -r df0e563861bd db/models/fields/__init__.py
a
|
b
|
|
63 | 63 | max_length=None, unique=False, blank=False, null=False, |
64 | 64 | db_index=False, rel=None, default=NOT_PROVIDED, editable=True, |
65 | 65 | 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, |
67 | 67 | db_tablespace=None, auto_created=False): |
| 68 | self.multi_choices = multi_choices |
68 | 69 | self.name = name |
69 | 70 | self.verbose_name = verbose_name |
70 | 71 | self.primary_key = primary_key |
… |
… |
|
315 | 316 | defaults['coerce'] = self.to_python |
316 | 317 | if self.null: |
317 | 318 | 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 |
319 | 323 | # Many of the subclass-specific formfield arguments (min_value, |
320 | 324 | # max_value) don't apply for choice fields, so be sure to only pass |
321 | 325 | # the values that TypedChoiceField will understand. |