aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-02-12 13:44:05 +0100
committerAlban Gruin2017-02-12 13:44:05 +0100
commita543aaa14957f390d2b640a264113b639c7d3194 (patch)
tree62bf0fdbd83717f3020dad2313dd1f4f4a9dcdce /views.py
parent3d5d17475909a6b351fadf8bbdb0bf8dc8d8e928 (diff)
parent908ed3b4d0bc57131f6dafc663c6f7e098f0b7e1 (diff)
Merge branch 'stable/0.y.z' into prod/pa1ch/0.y.zv0.6.0-pa1ch
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)