mirror of
https://github.com/django/django.git
synced 2025-07-25 14:14:13 +00:00
Replaced an antiquated pattern.
Thanks Lennart Regebro for pointing it out.
This commit is contained in:
parent
b1bfd9630e
commit
9c487b5974
30 changed files with 49 additions and 43 deletions
|
@ -775,7 +775,7 @@ class MultiWidget(Widget):
|
|||
You'll probably want to use this class with MultiValueField.
|
||||
"""
|
||||
def __init__(self, widgets, attrs=None):
|
||||
self.widgets = [isinstance(w, type) and w() or w for w in widgets]
|
||||
self.widgets = [w() if isinstance(w, type) else w for w in widgets]
|
||||
super(MultiWidget, self).__init__(attrs)
|
||||
|
||||
def render(self, name, value, attrs=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue