mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
06315375ce
commit
9e8a5969e7
|
@ -346,13 +346,7 @@ class ModelChoiceField(ChoiceField):
|
||||||
# the queryset.
|
# the queryset.
|
||||||
return ModelChoiceIterator(self)
|
return ModelChoiceIterator(self)
|
||||||
|
|
||||||
def _set_choices(self, value):
|
choices = property(_get_choices, ChoiceField._set_choices)
|
||||||
# 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)
|
|
||||||
|
|
||||||
def clean(self, value):
|
def clean(self, value):
|
||||||
Field.clean(self, value)
|
Field.clean(self, value)
|
||||||
|
|
Loading…
Reference in New Issue