Kaydet (Commit) 9e8a5969 authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #7171 -- Removed some redundant code in ModelChoiceField. Thanks for the…

Fixed #7171 -- Removed some redundant code in ModelChoiceField. Thanks for the patch, sebastian_noack

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7644 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 06315375
......@@ -346,13 +346,7 @@ class ModelChoiceField(ChoiceField):
# the queryset.
return ModelChoiceIterator(self)
def _set_choices(self, value):
# This method is copied from ChoiceField._set_choices(). It's necessary
# because property() doesn't allow a subclass to overwrite only
# _get_choices without implementing _set_choices.
self._choices = self.widget.choices = list(value)
choices = property(_get_choices, _set_choices)
choices = property(_get_choices, ChoiceField._set_choices)
def clean(self, value):
Field.clean(self, value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment