From 1479fe68e9f2e20aaf06fa05fc8d6d382f081913 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 6 Aug 2021 14:32:35 +0200 Subject: [PATCH] fd --- files/classes/submission.py | 1 + files/routes/front.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 7247f35c2..cb8e135ab 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -77,6 +77,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): primaryjoin="Submission.is_approved==User.id") awards = relationship("AwardRelationship", lazy="joined") + # scoresex = deferred(Column(Float, server_default=FetchedValue())) def __init__(self, *args, **kwargs): diff --git a/files/routes/front.py b/files/routes/front.py index 55022ad20..8cdee596e 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -130,9 +130,10 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words='' posts = sorted(posts.all(), key=lambda x: x.score, reverse=True) print(time.time() - time1) elif sort == "bottom": - time1 = time.time() - posts = posts.order_by(Submission.sexscore.desc()).all() - print(time.time() - time1) + posts = sorted(posts.all(), key=lambda x: x.score) + # time1 = time.time() + # posts = posts.order_by(Submission.sexscore.desc()).all() + # print(time.time() - time1) elif sort == "comments": posts = posts.order_by(Submission.comment_count.desc()).all() elif sort == "random":