czx
This commit is contained in:
parent
7ad1f6a09a
commit
fec9277e0f
1 changed files with 4 additions and 4 deletions
|
@ -179,7 +179,7 @@ def post_id(pid, anything=None, v=None):
|
|||
elif sort == "bottom":
|
||||
comments = comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||
|
||||
first = [c[0] for c in comments.filter(Comment.slots_result == None, Comment.blackjack_result == None, func.length(Comment.body) > 20).all()]
|
||||
first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None), func.length(Comment.body) > 20)).all()]
|
||||
second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None), func.length(Comment.body) <= 20).all()]
|
||||
comments = first + second
|
||||
else:
|
||||
|
@ -198,7 +198,7 @@ def post_id(pid, anything=None, v=None):
|
|||
elif sort == "bottom":
|
||||
comments = comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||
|
||||
first = comments.filter(Comment.slots_result == None, Comment.blackjack_result == None, func.length(Comment.body) > 20).all()
|
||||
first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None), func.length(Comment.body) > 20)).all()
|
||||
second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None), func.length(Comment.body) <= 20).all()
|
||||
comments = first + second
|
||||
|
||||
|
@ -302,7 +302,7 @@ def viewmore(v, pid, sort, offset):
|
|||
elif sort == "bottom":
|
||||
comments = comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||
|
||||
first = [c[0] for c in comments.filter(Comment.slots_result == None, Comment.blackjack_result == None, func.length(Comment.body) > 20).all()]
|
||||
first = [c[0] for c in comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None), func.length(Comment.body) > 20)).all()]
|
||||
second = [c[0] for c in comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None), func.length(Comment.body) <= 20).all()]
|
||||
comments = first + second
|
||||
comments = comments[offset:]
|
||||
|
@ -320,7 +320,7 @@ def viewmore(v, pid, sort, offset):
|
|||
elif sort == "bottom":
|
||||
comments = comments.order_by(Comment.upvotes - Comment.downvotes)
|
||||
|
||||
first = comments.filter(Comment.slots_result == None, Comment.blackjack_result == None, func.length(Comment.body) > 20).all()
|
||||
first = comments.filter(or_(and_(Comment.slots_result == None, Comment.blackjack_result == None), func.length(Comment.body) > 20)).all()
|
||||
second = comments.filter(or_(Comment.slots_result != None, Comment.blackjack_result != None), func.length(Comment.body) <= 20).all()
|
||||
comments = first + second
|
||||
comments = comments[offset:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue