.
This commit is contained in:
@@ -8,6 +8,7 @@ class DinosaurForm(forms.ModelForm):
|
||||
fields = [
|
||||
'name', 'era', 'diet', 'description', 'image',
|
||||
'speed', 'weight', 'intelligence', 'height',
|
||||
'facts',
|
||||
]
|
||||
widgets = {
|
||||
'name': forms.TextInput(attrs={'class': 'input', 'placeholder': 'T. rex'}),
|
||||
@@ -21,6 +22,9 @@ class DinosaurForm(forms.ModelForm):
|
||||
'height': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
|
||||
}
|
||||
|
||||
# Add facts field widget
|
||||
widgets['facts'] = forms.Textarea(attrs={'class': 'textarea', 'rows': 3, 'placeholder': 'One fact per line'})
|
||||
|
||||
|
||||
from .models import BackgroundImage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user