mirror of
https://github.com/django/django.git
synced 2025-07-22 12:45:18 +00:00
Fixed #25085 -- Overrode Select widget's __deepcopy__()
This commit is contained in:
parent
035b0fa60d
commit
8ee6a3f1a8
2 changed files with 22 additions and 0 deletions
|
@ -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 = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue