Commit 9e8a5969 authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

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
parent 06315375
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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)