Ticket #4787: ModelChoiceField_widget_choices.patch
| File ModelChoiceField_widget_choices.patch, 0.7 kB (added by fero <luca.ferroni@labs.it>, 1 year ago) |
|---|
-
newforms/models.py
old new 142 142 Field.__init__(self, required, widget, label, initial, help_text) 143 143 self.widget.choices = self.choices 144 144 145 def _get_queryset(self): 146 return self._queryset 147 148 def _set_queryset(self, value): 149 self._queryset = value 150 self.widget.choices = self.choices 151 152 queryset = property(_get_queryset, _set_queryset) 153 145 154 def _get_choices(self): 146 155 # If self._choices is set, then somebody must have manually set 147 156 # the property self.choices. In this case, just return self._choices.
