Sort habits by already done and slot
This commit is contained in:
parent
395133728f
commit
4fd34ba5bc
4
app.py
4
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user