form
This commit is contained in:
parent
cd696ef6e4
commit
d08d86f99b
3 changed files with 46 additions and 7 deletions
28
fbf/forms.py
Normal file
28
fbf/forms.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from datetime import date
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .models import FallenBird
|
||||
|
||||
|
||||
class DateInput(forms.DateInput):
|
||||
input_type = "date"
|
||||
|
||||
|
||||
class BirdForm(forms.ModelForm):
|
||||
class Meta:
|
||||
widgets = {"date_found": DateInput()}
|
||||
model = FallenBird
|
||||
fields = [
|
||||
"bird",
|
||||
"date_found",
|
||||
"place",
|
||||
"rescuer",
|
||||
]
|
||||
labels = {
|
||||
"bird": _("Vogel"),
|
||||
"date_found": _("Datum des Fundes"),
|
||||
"place": _("Fundort"),
|
||||
"rescuer": _("Finder"),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue