feat: Add basic flow to add adoption notices
This commit is contained in:
23
src/fellchensammlung/forms.py
Normal file
23
src/fellchensammlung/forms.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
fields = ['name', "species", "sex", "date_of_birth", "description", "photos"]
|
||||
widgets = {
|
||||
'date_of_birth': DateInput(),
|
||||
}
|
Reference in New Issue
Block a user