diff options
-rw-r--r-- | feeds.py | 4 | ||||
-rw-r--r-- | models.py | 2 | ||||
-rw-r--r-- | views.py | 6 |
3 files changed, 6 insertions, 6 deletions
@@ -60,7 +60,7 @@ class IcalFeed(Feed): try: timetable = Timetable.objects.get(year__slug=year_slug, slug=timetable_slug) - group = Group.objects.get(timetable=timetable.source, + group = Group.objects.get(source=timetable.source, slug=group_slug) except: raise ObjectDoesNotExist @@ -106,7 +106,7 @@ class RSSFeed(Feed): try: self.timetable = Timetable.objects.get(year__slug=year_slug, slug=timetable_slug) - self.group = Group.objects.get(timetable=self.timetable.source, + self.group = Group.objects.get(source=self.timetable.source, slug=group_slug) except: raise ObjectDoesNotExist @@ -92,7 +92,7 @@ class GroupManager(Manager): return self.get_queryset().filter(groups_criteria, Q(semester=None) | Q(semester=group.semester), mention=group.mention, - timetable=group.timetable) + source=group.source) class Group(SlugModel): @@ -37,7 +37,7 @@ def mention_list(request, year_slug): def group_list(request, year_slug, timetable_slug): timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug) - groups = Group.objects.filter(timetable=timetable.source, hidden=False).order_by("name") + groups = Group.objects.filter(source=timetable.source, hidden=False).order_by("name") start, _ = get_week(*get_current_week()) end = start + datetime.timedelta(weeks=4) @@ -89,14 +89,14 @@ def timetable_common(request, obj, year=None, week=None, timetable=None): def timetable(request, year_slug, timetable_slug, group_slug, year=None, week=None): timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug) - group = get_object_or_404(Group, slug=group_slug, timetable=timetable.source) + group = get_object_or_404(Group, slug=group_slug, source=timetable.source) return timetable_common(request, group, year, week, timetable) def calendars(request, year_slug, timetable_slug, group_slug): timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug) - group = get_object_or_404(Group, timetable=timetable.source, slug=group_slug) + group = get_object_or_404(Group, source=timetable.source, slug=group_slug) groups = Group.objects.get_parents(group).annotate(length=Length("subgroup")) \ .order_by("length") |