From 2dc2c6d73191a016eb4b0a226f6562fb808a1d8b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 6 Aug 2021 14:33:49 +0200 Subject: [PATCH] fd --- files/classes/submission.py | 2 +- files/routes/front.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index cb8e135ab..22eba63b3 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -77,7 +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())) + 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 8cdee596e..55022ad20 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -130,10 +130,9 @@ 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": - posts = sorted(posts.all(), key=lambda x: x.score) - # time1 = time.time() - # posts = posts.order_by(Submission.sexscore.desc()).all() - # print(time.time() - time1) + 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":