From 9e8a5969e78b6719fedd74683c3083247593519d Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 16 Jun 2008 03:22:44 +0000 Subject: [PATCH] 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 --- django/newforms/models.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/django/newforms/models.py b/django/newforms/models.py index 0590839b25..78a204125f 100644 --- a/django/newforms/models.py +++ b/django/newforms/models.py @@ -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)