Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #7171 -- Removed some redundant code in ModelChoiceField. Thank…

…s for the patch, sebastian_noack

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7644 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9e8a5969e78b6719fedd74683c3083247593519d 1 parent 0631537
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 7 deletions.
  1. +1 −7 django/newforms/models.py
View
8 django/newforms/models.py
@@ -346,13 +346,7 @@ def _get_choices(self):
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.