.
This commit is contained in:
+6
-5
@@ -7,7 +7,7 @@ class DinosaurForm(forms.ModelForm):
|
||||
model = Dinosaur
|
||||
fields = [
|
||||
'name', 'era', 'diet', 'description', 'image',
|
||||
'speed', 'weight', 'intelligence', 'height',
|
||||
'background', 'speed', 'weight', 'intelligence', 'height',
|
||||
'facts',
|
||||
]
|
||||
widgets = {
|
||||
@@ -16,10 +16,11 @@ class DinosaurForm(forms.ModelForm):
|
||||
'diet': forms.Select(attrs={'class': 'input'}),
|
||||
'description': forms.Textarea(attrs={'class': 'textarea', 'rows': 3}),
|
||||
'image': forms.ClearableFileInput(attrs={'class': 'file-input'}),
|
||||
'speed': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
'weight': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
'intelligence': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
'height': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
'background': forms.Select(attrs={'class': 'input'}),
|
||||
'speed': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': int(Dinosaur.SPEED_MAX_KMH), 'placeholder': 'km/h'}),
|
||||
'weight': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': int(Dinosaur.WEIGHT_MAX_KG), 'placeholder': 'kg'}),
|
||||
'intelligence': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100, 'placeholder': '0-100 score'}),
|
||||
'height': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': int(Dinosaur.HEIGHT_MAX_M), 'step': '0.1', 'placeholder': 'metres'}),
|
||||
}
|
||||
|
||||
# Add facts field widget
|
||||
|
||||
Reference in New Issue
Block a user