master
Aevann1 2021-08-06 14:32:35 +02:00
parent 6dd2cfe6f9
commit 1479fe68e9
2 changed files with 5 additions and 3 deletions

View File

@ -77,6 +77,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
primaryjoin="Submission.is_approved==User.id") primaryjoin="Submission.is_approved==User.id")
awards = relationship("AwardRelationship", lazy="joined") awards = relationship("AwardRelationship", lazy="joined")
# scoresex = deferred(Column(Float, server_default=FetchedValue()))
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@ -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) posts = sorted(posts.all(), key=lambda x: x.score, reverse=True)
print(time.time() - time1) print(time.time() - time1)
elif sort == "bottom": elif sort == "bottom":
time1 = time.time() posts = sorted(posts.all(), key=lambda x: x.score)
posts = posts.order_by(Submission.sexscore.desc()).all() # time1 = time.time()
print(time.time() - time1) # posts = posts.order_by(Submission.sexscore.desc()).all()
# print(time.time() - time1)
elif sort == "comments": elif sort == "comments":
posts = posts.order_by(Submission.comment_count.desc()).all() posts = posts.order_by(Submission.comment_count.desc()).all()
elif sort == "random": elif sort == "random":