Ticket #7171: 0001-Removed-_set_choices-method-from-ModelChoiceField-w.patch

File 0001-Removed-_set_choices-method-from-ModelChoiceField-w.patch, 1.1 KB (added by Sebastian Noack, 16 years ago)
  • django/newforms/models.py

    From fe8b19cfc0b47027ad5889e3b25977476d5e02fd Mon Sep 17 00:00:00 2001
    From: Sebastian Noack <sebastian.noack@gmail.com>
    Date: Mon, 5 May 2008 10:29:44 +0200
    Subject: [PATCH] Removed _set_choices method from ModelChoiceField, which was copied from ChoiceField.
    
    ---
     django/newforms/models.py |    8 +-------
     1 files changed, 1 insertions(+), 7 deletions(-)
    
    diff --git a/django/newforms/models.py b/django/newforms/models.py
    index 0590839..78a2041 100644
    a b class ModelChoiceField(ChoiceField):  
    346346        # the queryset.
    347347        return ModelChoiceIterator(self)
    348348
    349     def _set_choices(self, value):
    350         # This method is copied from ChoiceField._set_choices(). It's necessary
    351         # because property() doesn't allow a subclass to overwrite only
    352         # _get_choices without implementing _set_choices.
    353         self._choices = self.widget.choices = list(value)
    354 
    355     choices = property(_get_choices, _set_choices)
     349    choices = property(_get_choices, ChoiceField._set_choices)
    356350
    357351    def clean(self, value):
    358352        Field.clean(self, value)
Back to Top