df
This commit is contained in:
parent
237ff4c2f2
commit
c135832749
3 changed files with 2 additions and 5 deletions
|
@ -193,7 +193,7 @@ class User(Base, Stndrd, Age_times):
|
|||
elif sort == "bottom":
|
||||
submissions = sorted(submissions.all(), key=lambda x: x.score)
|
||||
elif sort == "comments":
|
||||
submissions = sorted(submissions.all(), key=lambda x: x.comment_count, reverse=True)
|
||||
submissions = submissions.order_by(Submission.comment_count.desc()).all()
|
||||
|
||||
firstrange = 25 * (page - 1)
|
||||
secondrange = firstrange + 26
|
||||
|
|
|
@ -884,9 +884,6 @@ def submit_post(v):
|
|||
g.db.add(c)
|
||||
g.db.flush()
|
||||
|
||||
new_post.comment_count = g.db.query(Comment).filter_by(parent_submission=new_post.id).count()
|
||||
g.db.add(new_post)
|
||||
|
||||
if "rdrama" in request.host:
|
||||
if v.id == 995: body = "fuck off carp"
|
||||
else: body = random.choice(snappyquotes)
|
||||
|
|
|
@ -127,7 +127,7 @@ def searchlisting(criteria, v=None, page=1, t="None", sort="top", b=None):
|
|||
elif sort == "bottom":
|
||||
posts = sorted(posts.all(), key=lambda x: x.score)
|
||||
elif sort == "comments":
|
||||
posts = sorted(posts.all(), key=lambda x: x.comment_count, reverse=True)
|
||||
posts = posts.order_by(Submission.comment_count.desc()).all()
|
||||
elif sort == "random":
|
||||
posts = posts.all()
|
||||
posts = random.sample(posts, k=len(posts))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue