mirror of
https://github.com/django/django.git
synced 2024-11-21 19:09:18 +01:00
Added use_fieldset=True to all the admin widgets
This commit is contained in:
parent
b9aa3239ab
commit
771d3ac3d7
@ -27,6 +27,8 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
catalog has been loaded in the page
|
||||
"""
|
||||
|
||||
use_fieldset = True
|
||||
|
||||
class Media:
|
||||
js = [
|
||||
"admin/js/core.js",
|
||||
@ -50,6 +52,8 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
|
||||
|
||||
class BaseAdminDateWidget(forms.DateInput):
|
||||
use_fieldset = True
|
||||
|
||||
class Media:
|
||||
js = [
|
||||
"admin/js/calendar.js",
|
||||
@ -66,6 +70,8 @@ class AdminDateWidget(BaseAdminDateWidget):
|
||||
|
||||
|
||||
class BaseAdminTimeWidget(forms.TimeInput):
|
||||
use_fieldset = True
|
||||
|
||||
class Media:
|
||||
js = [
|
||||
"admin/js/calendar.js",
|
||||
@ -86,6 +92,7 @@ class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
A SplitDateTime Widget that has some admin-specific styling.
|
||||
"""
|
||||
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/split_datetime.html"
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
@ -102,10 +109,12 @@ class AdminSplitDateTime(forms.SplitDateTimeWidget):
|
||||
|
||||
|
||||
class AdminRadioSelect(forms.RadioSelect):
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/radio.html"
|
||||
|
||||
|
||||
class AdminFileWidget(forms.ClearableFileInput):
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/clearable_file_input.html"
|
||||
|
||||
|
||||
@ -135,6 +144,7 @@ class ForeignKeyRawIdWidget(forms.TextInput):
|
||||
in a <select> box.
|
||||
"""
|
||||
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/foreign_key_raw_id.html"
|
||||
|
||||
def __init__(self, rel, admin_site, attrs=None, using=None):
|
||||
@ -249,6 +259,7 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
admin interface.
|
||||
"""
|
||||
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/related_widget_wrapper.html"
|
||||
|
||||
def __init__(
|
||||
@ -362,21 +373,28 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
|
||||
|
||||
class AdminTextareaWidget(forms.Textarea):
|
||||
use_fieldset = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
super().__init__(attrs={"class": "vLargeTextField", **(attrs or {})})
|
||||
|
||||
|
||||
class AdminTextInputWidget(forms.TextInput):
|
||||
use_fieldset = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
super().__init__(attrs={"class": "vTextField", **(attrs or {})})
|
||||
|
||||
|
||||
class AdminEmailInputWidget(forms.EmailInput):
|
||||
use_fieldset = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
super().__init__(attrs={"class": "vTextField", **(attrs or {})})
|
||||
|
||||
|
||||
class AdminURLFieldWidget(forms.URLInput):
|
||||
use_fieldset = True
|
||||
template_name = "admin/widgets/url.html"
|
||||
|
||||
def __init__(self, attrs=None, validator_class=URLValidator):
|
||||
@ -400,6 +418,7 @@ class AdminURLFieldWidget(forms.URLInput):
|
||||
|
||||
|
||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||
use_fieldset = True
|
||||
class_name = "vIntegerField"
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
@ -411,6 +430,8 @@ class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget):
|
||||
|
||||
|
||||
class AdminUUIDInputWidget(forms.TextInput):
|
||||
use_fieldset = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
super().__init__(attrs={"class": "vUUIDField", **(attrs or {})})
|
||||
|
||||
@ -598,8 +619,10 @@ class AutocompleteMixin:
|
||||
|
||||
|
||||
class AutocompleteSelect(AutocompleteMixin, forms.Select):
|
||||
use_fieldset = True
|
||||
pass
|
||||
|
||||
|
||||
class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple):
|
||||
use_fieldset = True
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user