aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/forum.py3
-rw-r--r--apioforum/thread.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/apioforum/forum.py b/apioforum/forum.py
index 98c71f7..30e29cb 100644
--- a/apioforum/forum.py
+++ b/apioforum/forum.py
@@ -29,7 +29,8 @@ def view_forum():
thread_tags[thread['id']] = db.execute(
"""SELECT tags.* FROM tags
INNER JOIN thread_tags ON thread_tags.tag = tags.id
- WHERE thread_tags.thread = ?;
+ WHERE thread_tags.thread = ?
+ ORDER BY tags.id;
""",(thread['id'],)).fetchall()
return render_template("view_forum.html",threads=threads,thread_tags=thread_tags)
diff --git a/apioforum/thread.py b/apioforum/thread.py
index 292fd21..ad02b68 100644
--- a/apioforum/thread.py
+++ b/apioforum/thread.py
@@ -26,7 +26,8 @@ def view_thread(thread_id):
tags = db.execute(
"""SELECT tags.* FROM tags
INNER JOIN thread_tags ON thread_tags.tag = tags.id
- WHERE thread_tags.thread = ?""",(thread_id,)).fetchall()
+ WHERE thread_tags.thread = ?
+ ORDER BY tags.id""",(thread_id,)).fetchall()
rendered_posts = [render(q['content']) for q in posts]
return render_template("view_thread.html",posts=posts,thread=thread,rendered_posts=rendered_posts,tags=tags)