Skip to content
Snippets Groups Projects
Verified Commit b5543223 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Optimize forms.py

parent 8249be96
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,11 @@ from .models import Menu
current_year = timezone.datetime.now().year
options_for_year = [(current_year, current_year), (current_year + 1, current_year + 1)]
calendar_weeks = [(cw, cw) for cw in range(1, 53)]
calendar_weeks = [(cw, str(cw)) for cw in range(1, 53)]
class MenuUploadForm(forms.ModelForm):
calendar_week = forms.ChoiceField(choices=calendar_weeks)
calendar_week = forms.ChoiceField(choices=calendar_weeks, initial=timezone.datetime.now().isocalendar()[1])
year = forms.ChoiceField(
initial=timezone.datetime.now().year, choices=options_for_year
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment