From 22529d41b26137ac87c5e08a6c19e6e91552756e Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 16 Jun 2011 16:34:38 +0000 Subject: 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 --- django/forms/fields.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'django/forms/fields.py') 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 -- cgit v1.3