fds
This commit is contained in:
parent
cb9ee30fa5
commit
f7be84f0fc
1 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ def notifications(v):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
# @cache.memoize(timeout=86400)
|
||||||
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs):
|
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs):
|
||||||
|
|
||||||
posts = g.db.query(Submission).options(lazyload('*'))
|
posts = g.db.query(Submission).options(lazyload('*'))
|
||||||
|
@ -179,7 +179,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
||||||
elif sort == "controversial":
|
elif sort == "controversial":
|
||||||
posts = sorted(posts.all(), key=lambda x: x.score_disputed, reverse=True)
|
posts = sorted(posts.all(), key=lambda x: x.score_disputed, reverse=True)
|
||||||
elif sort == "top":
|
elif sort == "top":
|
||||||
posts = sorted(posts.all(), key=lambda x: x.score, reverse=True)
|
posts = posts.order_by(Submission.upvotes - Submission.downvotes).all()
|
||||||
elif sort == "bottom":
|
elif sort == "bottom":
|
||||||
posts = sorted(posts.all(), key=lambda x: x.score)
|
posts = sorted(posts.all(), key=lambda x: x.score)
|
||||||
elif sort == "comments":
|
elif sort == "comments":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue