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:
|
else:
|
||||||
habit.checked = False
|
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(
|
return render_template(
|
||||||
'index.html',
|
'index.html',
|
||||||
title=name,
|
title=name,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user