vxc
This commit is contained in:
parent
683be1485c
commit
d1b12da8e4
5 changed files with 11 additions and 11 deletions
|
@ -149,7 +149,7 @@ def searchposts(v):
|
|||
elif sort == "old":
|
||||
posts = posts.order_by(Submission.created_utc.asc())
|
||||
elif sort == "controversial":
|
||||
posts = posts.order_by(Submission.upvotes/Submission.downvotes + Submission.downvotes/Submission.upvotes)
|
||||
posts = posts.order_by((Submission.downvotes+1)/(Submission.downvotes+1) + (Submission.downvotes+1)/(Submission.upvotes+1))
|
||||
elif sort == "top":
|
||||
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
|
||||
elif sort == "bottom":
|
||||
|
@ -255,7 +255,7 @@ def searchcomments(v):
|
|||
elif sort == "old":
|
||||
comments = comments.order_by(Comment.created_utc.asc())
|
||||
elif sort == "controversial":
|
||||
comments = comments.order_by(Comment.upvotes/Comment.downvotes + Comment.downvotes/Comment.upvotes)
|
||||
comments = comments.order_by((Comment.downvotes+1)/(Comment.downvotes+1) + (Comment.downvotes+1)/(Comment.upvotes+1))
|
||||
elif sort == "top":
|
||||
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
|
||||
elif sort == "bottom":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue