aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/views.py b/views.py
index 273720a..651533a 100644
--- a/views.py
+++ b/views.py
@@ -22,14 +22,14 @@ from django.core.mail import send_mail
from django.conf import settings
from django.template import Context, loader
-from edt.forms import SubscribeForm
-from edt.models import Timetable, LastUpdate, Group, Subscription, Course
-from edt.utils import get_current_week, get_week, group_courses
+from .forms import SubscribeForm
+from .models import Timetable, LastUpdate, Group, Subscription, Course
+from .utils import get_current_week, get_week, group_courses
import datetime
def index(request):
- timetables = Timetable.objects.all()
+ timetables = Timetable.objects.all().order_by("name")
groups = Group.objects.filter(tp__isnull=False).order_by("name")
year, week = get_current_week()
@@ -59,8 +59,8 @@ def timetable(request, timetable_slug, group_slug, year=None, week=None):
timetable = get_object_or_404(Timetable, slug=timetable_slug)
group = get_object_or_404(Group, slug=group_slug, timetable=timetable)
+ last_update = get_object_or_404(LastUpdate, timetable=timetable, week=week, year=year)
courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end)
- last_update = LastUpdate.objects.get(timetable=timetable, week=week, year=year)
grouped_courses = group_courses(courses)