summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-16 16:34:38 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-16 16:34:38 +0000
commit22529d41b26137ac87c5e08a6c19e6e91552756e (patch)
treee6e64b71867159cf38813ae82bb989f116eaa60d /django/forms
parentaa40dc6252b00af15973a9075de48f9462fabdcd (diff)
Fixed #15127 -- Properly copy the choices of choice fields. Thanks, dready and Julian Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16416 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/fields.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 7bee36ee6e..113a5aab22 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -657,6 +657,11 @@ class ChoiceField(Field):
initial=initial, help_text=help_text, *args, **kwargs)
self.choices = choices
+ def __deepcopy__(self, memo):
+ result = super(ChoiceField, self).__deepcopy__(memo)
+ result._choices = copy.deepcopy(self._choices, memo)
+ return result
+
def _get_choices(self):
return self._choices