To elaborate on this further:
Searching the web for this yields numerous hits, e.g.
https://stackoverflow.com/questions/16026479/django-forms-default-values-for-bound-forms mentions some ways to address this, but I've not come across a fully satisfactory solution.
Another approach might be this:
params = {'year': '2019'} # default values
params.update(request.GET)
year_form = JahrAuswahl(params)
# Can now use year_form normally, as intended:
if not year_form.is_valid():
# Pass year_form to the view to re-render the form with errors.
return render(..., {'year_form': year_form})
# year_form is valid, now use the year_form.cleaned_data values.
# If (unrelated) request.POST data turns out to be invalid,
# we may re-render year_form in this code path as well.
# ...
Thoughts?
Best regards,
Carsten