home
·
contact
·
privacy
projects
/
misc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a546cea
)
Minor calories counter improvement.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 4 Oct 2023 18:57:03 +0000
(20:57 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 4 Oct 2023 18:57:03 +0000
(20:57 +0200)
calories.py
patch
|
blob
|
history
diff --git
a/calories.py
b/calories.py
index dc40d5ff9e58cfaabf14ca2c43c6841e42dbd0c4..5ab57044eb3bd7333f7764ab62938d071473e72b 100644
(file)
--- a/
calories.py
+++ b/
calories.py
@@
-287,6
+287,7
@@
class MyServer(BaseHTTPRequestHandler):
"<td><input name=\"delete\" type=\"checkbox\" value=\"%s\" /></td>"\
"</tr>" % (k, v.title, v.cals, v.sugar_g, v.standard_g, v.comments, k)
consumptions = ""
+ db.consumptions = sorted(db.consumptions, key=lambda x: db.eatables[x.eatable_key].title)
for c in db.consumptions:
r = db.calc_consumption(c)
consumptions += "<tr />"\