mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #25085 -- Overrode Select widget's __deepcopy__()
This commit is contained in:
committed by
Tim Graham
parent
035b0fa60d
commit
8ee6a3f1a8
@@ -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 = ''
|
||||
|
||||
Reference in New Issue
Block a user