Ticket #18162: form_class_for_choices.patch
File form_class_for_choices.patch, 726 bytes (added by , 13 years ago) |
---|
-
django/db/models/fields/__init__.py
474 474 defaults['coerce'] = self.to_python 475 475 if self.null: 476 476 defaults['empty_value'] = None 477 form_class = forms.TypedChoiceField477 form_class = kwargs.pop("form_class_for_choices", forms.TypedChoiceField) 478 478 # Many of the subclass-specific formfield arguments (min_value, 479 479 # max_value) don't apply for choice fields, so be sure to only pass 480 480 # the values that TypedChoiceField will understand.