Commit 03fbe161 authored by Luuk Scholten's avatar Luuk Scholten
Browse files

Add previous years for upload exam form

Fix #269
parent 799f12e5
import datetime
from django.conf import settings
from django.forms import (ChoiceField, DateField, ModelChoiceField,
ModelForm, SelectDateWidget)
......@@ -6,8 +8,11 @@ from .models import Course, Exam, Summary
class AddExamForm(ModelForm):
this_year = datetime.date.today().year
years = list(reversed(range(this_year - 8, this_year + 1)))
exam_date = DateField(
widget=SelectDateWidget(),
widget=SelectDateWidget(years=years),
initial=datetime.date.today
)
course = ModelChoiceField(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment