asc is default so u dont need to specify it

pull/222/head
Aevann 2024-02-03 00:56:08 +02:00
parent fbadbed672
commit 8b08957e4c
3 changed files with 6 additions and 6 deletions

View File

@ -81,7 +81,7 @@ class Leaderboard:
@classmethod
def rank_filtered_rank_label_by_asc_sum(cls, criteria):
return func.rank().over(order_by=func.sum(criteria).asc()).label("rank")
return func.rank().over(order_by=func.sum(criteria)).label("rank")
@classmethod
def rank_filtered_rank_label_by_desc_avg(cls, criteria1, criteria2):

View File

@ -42,10 +42,10 @@ def get_game_leaderboard(game):
CasinoGame).join(User).order_by(CasinoGame.winnings.desc()).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
biggest_loss_all_time = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings.asc()).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
biggest_loss_last_24h = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings.asc()).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
if not biggest_win_all_time:
biggest_win_all_time = [None, None, None, 0]

View File

@ -1,7 +1,7 @@
import os
from shutil import copyfile
from sqlalchemy import func, asc, text
from sqlalchemy import func, text
from files.helpers.media import *
import files.helpers.stats as statshelper
@ -361,9 +361,9 @@ def blocks(v):
total = blocks.count()
if sort == "user":
key = asc(text('users_1_username'))
key = text('users_1_username')
elif sort == "target":
key = asc(text('users_2_username'))
key = text('users_2_username')
else:
sort = "time"
key = UserBlock.created_utc.desc()