Notfellchen/src/fellchensammlung/forms.py

24 lines
679 B
Python
Raw Normal View History

from django import forms
from .models import AdoptionNotice, Animal
class DateInput(forms.DateInput):
input_type = 'date'
class AdoptionNoticeForm(forms.ModelForm):
class Meta:
model = AdoptionNotice
fields = ['name', "group_only", "further_information", "description", "searching_since"]
widgets = {
'searching_since': DateInput(),
}
class AnimalForm(forms.ModelForm):
class Meta:
model = Animal
2024-03-20 10:38:30 +00:00
picture = forms.ImageField(label='Image', required=False)
fields = ['name', "species", "sex", "date_of_birth", "description"]
widgets = {
'date_of_birth': DateInput(),
}