summaryrefslogtreecommitdiffhomepage
path: root/apioforum/forum.py
diff options
context:
space:
mode:
Diffstat (limited to 'apioforum/forum.py')
-rw-r--r--apioforum/forum.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/apioforum/forum.py b/apioforum/forum.py
new file mode 100644
index 0000000..7fb1e57
--- /dev/null
+++ b/apioforum/forum.py
@@ -0,0 +1,15 @@
+# view threads in a forum
+# currently there is only ever one forum however
+
+from flask import (
+ Blueprint, render_template
+)
+from .db import get_db
+
+bp = Blueprint("forum", __name__, url_prefix="/")
+
+@bp.route("/")
+def view_forum():
+ db = get_db()
+ threads = db.execute("SELECT * FROM threads ORDER BY updated DESC LIMIT 10;").fetchall()
+ return render_template("view_forum.html.j2",threads=threads)