Zustand Volieren #16
This commit is contained in:
parent
6e642a9785
commit
49c5a0fb98
5 changed files with 106 additions and 4 deletions
27
aviary/forms.py
Normal file
27
aviary/forms.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from datetime import date
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .models import Aviary
|
||||
|
||||
|
||||
class DateInput(forms.DateInput):
|
||||
input_type = "date"
|
||||
|
||||
|
||||
class AviaryEditForm(forms.ModelForm):
|
||||
class Meta:
|
||||
widgets = {
|
||||
"last_ward_round": DateInput(format="%Y-%m-%d", attrs={"value": date.today})
|
||||
}
|
||||
model = Aviary
|
||||
fields = [
|
||||
"description",
|
||||
"condition",
|
||||
"last_ward_round",
|
||||
]
|
||||
labels = {
|
||||
"description": _("Bezeichnung"),
|
||||
"condition": _("Zustand"),
|
||||
"last_ward_round": _("Letzte Inspektion"),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue