diff --git a/app.py b/app.py index 9345001..dfff2d7 100644 --- a/app.py +++ b/app.py @@ -155,7 +155,9 @@ def index(): else: habit.checked = False - # habits = [("lesen", "eine Seite vor dem Schlafen gehen"), ("sport", "3x Gym")] + # Sort habits by whether they have been checked today and then by slot + habits.sort(key=lambda habit: (habit.checked, habit.slot)) + return render_template( 'index.html', title=name,