mirror of https://github.com/django/django.git
Fixed #17493 -- Made `Widget.id_for_label()` consistently be an instance method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ad8ebb7006
commit
1cd18f4cfd
|
@ -101,7 +101,6 @@ class SelectDateWidget(Widget):
|
||||||
return '%s_%s' % (id_, first_select)
|
return '%s_%s' % (id_, first_select)
|
||||||
else:
|
else:
|
||||||
return '%s_month' % id_
|
return '%s_month' % id_
|
||||||
id_for_label = classmethod(id_for_label)
|
|
||||||
|
|
||||||
def value_from_datadict(self, data, files, name):
|
def value_from_datadict(self, data, files, name):
|
||||||
y = data.get(self.year_field % name)
|
y = data.get(self.year_field % name)
|
||||||
|
|
|
@ -234,7 +234,6 @@ class Widget(object):
|
||||||
tags.
|
tags.
|
||||||
"""
|
"""
|
||||||
return id_
|
return id_
|
||||||
id_for_label = classmethod(id_for_label)
|
|
||||||
|
|
||||||
class Input(Widget):
|
class Input(Widget):
|
||||||
"""
|
"""
|
||||||
|
@ -735,7 +734,6 @@ class RadioSelect(Select):
|
||||||
if id_:
|
if id_:
|
||||||
id_ += '_0'
|
id_ += '_0'
|
||||||
return id_
|
return id_
|
||||||
id_for_label = classmethod(id_for_label)
|
|
||||||
|
|
||||||
class CheckboxSelectMultiple(SelectMultiple):
|
class CheckboxSelectMultiple(SelectMultiple):
|
||||||
def render(self, name, value, attrs=None, choices=()):
|
def render(self, name, value, attrs=None, choices=()):
|
||||||
|
@ -767,7 +765,6 @@ class CheckboxSelectMultiple(SelectMultiple):
|
||||||
if id_:
|
if id_:
|
||||||
id_ += '_0'
|
id_ += '_0'
|
||||||
return id_
|
return id_
|
||||||
id_for_label = classmethod(id_for_label)
|
|
||||||
|
|
||||||
class MultiWidget(Widget):
|
class MultiWidget(Widget):
|
||||||
"""
|
"""
|
||||||
|
@ -826,7 +823,6 @@ class MultiWidget(Widget):
|
||||||
if id_:
|
if id_:
|
||||||
id_ += '_0'
|
id_ += '_0'
|
||||||
return id_
|
return id_
|
||||||
id_for_label = classmethod(id_for_label)
|
|
||||||
|
|
||||||
def value_from_datadict(self, data, files, name):
|
def value_from_datadict(self, data, files, name):
|
||||||
return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]
|
return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]
|
||||||
|
|
Loading…
Reference in New Issue