Add serial number field to UPS host
This commit is contained in:
@@ -6,10 +6,11 @@ from .models import UPSHost, Battery
|
||||
class UPSHostForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = UPSHost
|
||||
fields = ['brand', 'model', 'ip_address', 'quantity', 'location', 'last_maintenance_date', 'contact']
|
||||
fields = ['brand', 'model', 'serial_number', 'ip_address', 'quantity', 'location', 'last_maintenance_date', 'contact']
|
||||
labels = {
|
||||
'brand': '品牌',
|
||||
'model': '型号',
|
||||
'serial_number': '序列号',
|
||||
'ip_address': 'IP地址',
|
||||
'quantity': '数量',
|
||||
'location': '存放位置',
|
||||
@@ -19,6 +20,7 @@ class UPSHostForm(forms.ModelForm):
|
||||
widgets = {
|
||||
'brand': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'model': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'serial_number': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'ip_address': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'quantity': forms.NumberInput(attrs={'class': 'form-control', 'min': '1'}),
|
||||
'location': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
|
||||
Reference in New Issue
Block a user