|
@@ -32,6 +32,7 @@ from utilities.forms.widgets import (
|
|
|
APISelect,
|
|
APISelect,
|
|
|
ClearableFileInput,
|
|
ClearableFileInput,
|
|
|
ClearableSelect,
|
|
ClearableSelect,
|
|
|
|
|
+ DatePicker,
|
|
|
HTMXSelect,
|
|
HTMXSelect,
|
|
|
NumberWithOptions,
|
|
NumberWithOptions,
|
|
|
SelectWithPK,
|
|
SelectWithPK,
|
|
@@ -510,6 +511,7 @@ class DeviceTypeForm(PrimaryModelForm):
|
|
|
'u_height', 'exclude_from_utilization', 'is_full_depth', 'part_number', 'subdevice_role', 'airflow',
|
|
'u_height', 'exclude_from_utilization', 'is_full_depth', 'part_number', 'subdevice_role', 'airflow',
|
|
|
'weight', 'weight_unit', name=_('Chassis')
|
|
'weight', 'weight_unit', name=_('Chassis')
|
|
|
),
|
|
),
|
|
|
|
|
+ FieldSet('end_of_life', name=_('Lifecycle')),
|
|
|
FieldSet('front_image', 'rear_image', name=_('Images')),
|
|
FieldSet('front_image', 'rear_image', name=_('Images')),
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -517,8 +519,8 @@ class DeviceTypeForm(PrimaryModelForm):
|
|
|
model = DeviceType
|
|
model = DeviceType
|
|
|
fields = [
|
|
fields = [
|
|
|
'manufacturer', 'model', 'slug', 'default_platform', 'part_number', 'u_height', 'exclude_from_utilization',
|
|
'manufacturer', 'model', 'slug', 'default_platform', 'part_number', 'u_height', 'exclude_from_utilization',
|
|
|
- 'is_full_depth', 'subdevice_role', 'airflow', 'weight', 'weight_unit', 'front_image', 'rear_image',
|
|
|
|
|
- 'description', 'owner', 'comments', 'tags',
|
|
|
|
|
|
|
+ 'is_full_depth', 'subdevice_role', 'airflow', 'weight', 'weight_unit', 'end_of_life', 'front_image',
|
|
|
|
|
+ 'rear_image', 'description', 'owner', 'comments', 'tags',
|
|
|
]
|
|
]
|
|
|
widgets = {
|
|
widgets = {
|
|
|
'front_image': ClearableFileInput(attrs={
|
|
'front_image': ClearableFileInput(attrs={
|
|
@@ -527,6 +529,7 @@ class DeviceTypeForm(PrimaryModelForm):
|
|
|
'rear_image': ClearableFileInput(attrs={
|
|
'rear_image': ClearableFileInput(attrs={
|
|
|
'accept': DEVICETYPE_IMAGE_FORMATS
|
|
'accept': DEVICETYPE_IMAGE_FORMATS
|
|
|
}),
|
|
}),
|
|
|
|
|
+ 'end_of_life': DatePicker(),
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -575,6 +578,7 @@ class ModuleTypeForm(PrimaryModelForm):
|
|
|
return [
|
|
return [
|
|
|
FieldSet('manufacturer', 'model', 'part_number', 'description', 'tags', name=_('Module Type')),
|
|
FieldSet('manufacturer', 'model', 'part_number', 'description', 'tags', name=_('Module Type')),
|
|
|
FieldSet('airflow', 'weight', 'weight_unit', name=_('Hardware')),
|
|
FieldSet('airflow', 'weight', 'weight_unit', name=_('Hardware')),
|
|
|
|
|
+ FieldSet('end_of_life', name=_('Lifecycle')),
|
|
|
FieldSet('profile', *self.attr_fields, name=_('Profile & Attributes'), html_id='profile-attributes')
|
|
FieldSet('profile', *self.attr_fields, name=_('Profile & Attributes'), html_id='profile-attributes')
|
|
|
]
|
|
]
|
|
|
|
|
|
|
@@ -582,8 +586,11 @@ class ModuleTypeForm(PrimaryModelForm):
|
|
|
model = ModuleType
|
|
model = ModuleType
|
|
|
fields = [
|
|
fields = [
|
|
|
'profile', 'manufacturer', 'model', 'part_number', 'description', 'airflow', 'weight', 'weight_unit',
|
|
'profile', 'manufacturer', 'model', 'part_number', 'description', 'airflow', 'weight', 'weight_unit',
|
|
|
- 'owner', 'comments', 'tags',
|
|
|
|
|
|
|
+ 'end_of_life', 'owner', 'comments', 'tags',
|
|
|
]
|
|
]
|
|
|
|
|
+ widgets = {
|
|
|
|
|
+ 'end_of_life': DatePicker(),
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|