Improve thread list appearance

This commit is contained in:
rubenwardy
2020-12-22 12:22:52 +00:00
parent 1064885a2c
commit df79159e2e
7 changed files with 108 additions and 45 deletions

View File

@@ -91,6 +91,9 @@ class Thread(db.Model):
else:
raise Exception("Permission {} is not related to threads".format(perm.name))
def get_latest_reply(self):
return ThreadReply.query.filter_by(thread_id=self.id).order_by(db.desc(ThreadReply.id)).first()
class ThreadReply(db.Model):
id = db.Column(db.Integer, primary_key=True)