From d981d7a1a76cdcf4b55268babc2a8dd3c6680f47 Mon Sep 17 00:00:00 2001
From: Dominik George <nik@naturalnet.de>
Date: Sun, 3 May 2020 17:16:01 +0200
Subject: [PATCH] Remove unusers hints code

---
 aleksis/apps/chronos/filters.py | 16 ----------
 aleksis/apps/chronos/hints.py   | 56 ---------------------------------
 2 files changed, 72 deletions(-)
 delete mode 100644 aleksis/apps/chronos/filters.py
 delete mode 100644 aleksis/apps/chronos/hints.py

diff --git a/aleksis/apps/chronos/filters.py b/aleksis/apps/chronos/filters.py
deleted file mode 100644
index 8df8771d..00000000
--- a/aleksis/apps/chronos/filters.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import django_filters
-from django.forms import Form
-from material import Fieldset, Row
-
-from .models import Hint
-
-
-class HintForm(Form):
-    layout = Row("from_date", "to_date", "classes", "teachers")
-
-
-class HintFilter(django_filters.FilterSet):
-    class Meta:
-        model = Hint
-        fields = ['from_date', "to_date", "classes", "teachers"]
-        form = HintForm
diff --git a/aleksis/apps/chronos/hints.py b/aleksis/apps/chronos/hints.py
deleted file mode 100644
index 89340aa9..00000000
--- a/aleksis/apps/chronos/hints.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import datetime
-
-from timetable.models import Hint
-
-
-def get_all_hints_by_date(date):
-    hints = filter_date(date)
-    return hints
-
-
-def get_all_hints_by_class_and_time_period(_class, from_date, to_date):
-    hints_tmp = get_all_hints_by_time_period(from_date, to_date)
-    hints_match = []
-    for hint in hints_tmp:
-        if _class.id in [x.class_id for x in hint.classes.all()]:
-            hints_match.append(hint)
-    return hints_match
-
-
-def get_all_hints_for_teachers_by_time_period(from_date, to_date):
-    hints_tmp = get_all_hints_by_time_period(from_date, to_date)
-    hints_match = []
-    for hint in hints_tmp:
-        if hint.teachers:
-            hints_match.append(hint)
-    return hints_match
-
-
-def get_all_hints_not_for_teachers_by_time_period(from_date, to_date):
-    hints_tmp = get_all_hints_by_time_period(from_date, to_date)
-    hints_match = []
-    for hint in hints_tmp:
-        if not hint.teachers:
-            hints_match.append(hint)
-    return hints_match
-
-
-def get_all_hints_by_time_period(from_date, to_date):
-    print(from_date, to_date)
-    delta = to_date - from_date
-    print(delta.days + 1)
-    week_days = [from_date + datetime.timedelta(days=i) for i in range(delta.days + 1)]
-
-    hints = []
-    for week_day in week_days:
-        hints_tmp = get_all_hints_by_date(week_day)
-        for hint in hints_tmp:
-            if hint not in hints:
-                hints.append(hint)
-    print(hints)
-    return hints
-
-
-def filter_date(date):
-    hints = Hint.objects.filter(from_date__lte=date, to_date__gte=date).order_by("from_date", "classes")
-    return hints
-- 
GitLab