From d450ad42c06590a9beaf931f6070ba7e00710d0a Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 16 Jun 2025 23:17:27 +0200 Subject: [PATCH] fix: Make sure date is pre-filled https://stackoverflow.com/questions/58294769/django-forms-dateinput-not-populating-from-instance --- src/fellchensammlung/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fellchensammlung/forms.py b/src/fellchensammlung/forms.py index ad7b54c..7f7010e 100644 --- a/src/fellchensammlung/forms.py +++ b/src/fellchensammlung/forms.py @@ -90,6 +90,10 @@ class AnimalForm(forms.ModelForm): model = Animal fields = ["name", "date_of_birth", "species", "sex", "description"] + widgets = { + 'date_of_birth': DateInput(format=('%Y-%m-%d')) + } + class AnimalFormWithDateWidget(AnimalForm): class Meta: