From 3883203c80d6ff8f4448a4374a13ec953952fe2c Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 25 Oct 2024 00:33:49 +0300 Subject: [PATCH] order the comments relationship by id (why not) --- files/classes/post.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/classes/post.py b/files/classes/post.py index b22bad651..fd0b066d0 100644 --- a/files/classes/post.py +++ b/files/classes/post.py @@ -83,7 +83,7 @@ class Post(Base): approved_by = relationship("User", uselist=False, primaryjoin="Post.is_approved==User.id") awards = relationship("AwardRelationship", order_by="AwardRelationship.awarded_utc.desc()", back_populates="post") reports = relationship("Report", order_by="Report.created_utc") - comments = relationship("Comment", primaryjoin="Comment.parent_post==Post.id", back_populates="post") + comments = relationship("Comment", primaryjoin="Comment.parent_post==Post.id", order_by="Comment.id", back_populates="post") hole_obj = relationship("Hole", primaryjoin="foreign(Post.hole)==remote(Hole.name)") options = relationship("PostOption", order_by="PostOption.id") edits = relationship("PostEdit", order_by="PostEdit.id.desc()")