summaryrefslogtreecommitdiff
path: root/django/forms/models.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2010-03-08 23:55:04 +0000
committerLuke Plant <L.Plant.98@cantab.net>2010-03-08 23:55:04 +0000
commit48cd8e856fa027e0e699e5a5ed7e3eb8f8450abb (patch)
tree41b315b426735f7220c5a8edab7e36c10be9b9ef /django/forms/models.py
parent960af90279081e7a4121736f3f2bc67077f11b31 (diff)
Fixed #11183 - BaseForm init leaves pointers pointing back to base_fields
Thanks to margieroginski for the report git-svn-id: http://code.djangoproject.com/svn/django/trunk@12733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/models.py')
-rw-r--r--django/forms/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index acfbe490d5..45a2e0cd16 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -923,6 +923,12 @@ class ModelChoiceField(ChoiceField):
self.choice_cache = None
self.to_field_name = to_field_name
+ def __deepcopy__(self, memo):
+ result = super(ChoiceField, self).__deepcopy__(memo)
+ # Need to force a new ModelChoiceIterator to be created, bug #11183
+ result.queryset = result.queryset
+ return result
+
def _get_queryset(self):
return self._queryset