Sort habits by already done and slot

This commit is contained in:
Verox001 2024-01-26 10:09:57 +01:00
parent 395133728f
commit 4fd34ba5bc

4
app.py
View File

@ -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,