.
This commit is contained in:
@@ -20,3 +20,17 @@ class DinosaurForm(forms.ModelForm):
|
||||
'intelligence': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
'height': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
}
|
||||
|
||||
|
||||
from .models import BackgroundImage
|
||||
|
||||
|
||||
class BackgroundImageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = BackgroundImage
|
||||
fields = ['title', 'image', 'is_active']
|
||||
widgets = {
|
||||
'title': forms.TextInput(attrs={'class': 'input', 'placeholder': 'Rocky desert'}),
|
||||
'image': forms.ClearableFileInput(attrs={'class': 'file-input'}),
|
||||
'is_active': forms.CheckboxInput(attrs={'class': 'checkbox'}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user