Fixed #25085 -- Overrode Select widget's __deepcopy__()

This commit is contained in:
Eric Carrillo 2015-07-08 19:03:11 -05:00 committed by Tim Graham
parent 035b0fa60d
commit 8ee6a3f1a8
2 changed files with 22 additions and 0 deletions

View file

@ -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 = ''