initial
This commit is contained in:
commit
55778039fb
5 files changed
+164
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import json
|
||||
import sqlite3
|
||||
|
||||
db = sqlite3.connect("mensa.db")
|
||||
|
||||
rows = db.execute("""
|
||||
SELECT date, mensa, type, title, description, category, allergens
|
||||
FROM dishes
|
||||
ORDER BY rowid DESC
|
||||
LIMIT 3
|
||||
""").fetchall()
|
||||
|
||||
for date, mensa, typ, title, description, category, allergens in rows:
|
||||
print(f"{date} | {mensa} | {typ}")
|
||||
print(f" {title}")
|
||||
print(f" {description}")
|
||||
print(f" category: {', '.join(json.loads(category))}")
|
||||
print(f" allergens: {', '.join(json.loads(allergens))}")
|
||||
print()
|
||||
|
||||
db.close()
|
||||
Reference in new issue
Block a user