summaryrefslogtreecommitdiff
path: root/django/forms/widgets.py
diff options
context:
space:
mode:
authorEric Carrillo <eric.carrillo@newcomlink.com>2015-07-08 19:03:11 -0500
committerTim Graham <timograham@gmail.com>2015-07-14 11:56:08 -0400
commit8ee6a3f1a855bf983639a14fc2393baa8ead741f (patch)
tree5b7da2f38bcd5caf9383c699c97ac1d9c7f35a98 /django/forms/widgets.py
parent035b0fa60da2e758d0ab7f9d04ef93cdb73c981f (diff)
Fixed #25085 -- Overrode Select widget's __deepcopy__()
Diffstat (limited to 'django/forms/widgets.py')
-rw-r--r--django/forms/widgets.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 896984dc08..c744d090ad 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -521,6 +521,13 @@ class Select(Widget):
# more than once.
self.choices = list(choices)
+ def __deepcopy__(self, memo):
+ obj = copy.copy(self)
+ obj.attrs = self.attrs.copy()
+ obj.choices = copy.copy(self.choices)
+ memo[id(self)] = obj
+ return obj
+
def render(self, name, value, attrs=None, choices=()):
if value is None:
value = ''