filter(Player.player_id == PlayerGameStat.player_id).\
filter(Player.player_id > 2).\
filter(PlayerGameStat.create_dt >
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\
order_by(expr.desc(func.sum(PlayerGameStat.alivetime))).\
group_by(Player.nick).\
group_by(Player.player_id).all()[0:10]
func.count()).\
filter(Game.server_id==Server.server_id).\
filter(Game.create_dt >
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\
order_by(expr.desc(func.count(Game.game_id))).\
group_by(Server.server_id).\
group_by(Server.name).all()[0:10]
func.count()).\
filter(Map.map_id==Game.map_id).\
filter(Game.create_dt >
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\
order_by(expr.desc(func.count())).\
group_by(Game.map_id).\
group_by(Map.name).all()[0:10]
filter(Map.map_id==Game.map_id).\\r
filter(Game.server_id==server.server_id).\\r
filter(Game.create_dt > \r
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\\r
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\\r
order_by(expr.desc(func.count())).\\r
group_by(Game.map_id).\\r
group_by(Map.name).all()[0:10]\r
filter(Game.server_id == server.server_id).\\r
filter(Player.player_id > 2).\\r
filter(PlayerGameStat.create_dt > \r
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\\r
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\\r
order_by(expr.desc(func.sum(PlayerGameStat.score))).\\r
group_by(Player.nick).\\r
group_by(Player.player_id).all()[0:10]\r
filter(Game.server_id == server.server_id).\\r
filter(Player.player_id > 2).\\r
filter(PlayerGameStat.create_dt > \r
- (datetime.now() - timedelta(days=leaderboard_lifetime))).\\r
+ (datetime.utcnow() - timedelta(days=leaderboard_lifetime))).\\r
order_by(expr.desc(func.sum(PlayerGameStat.alivetime))).\\r
group_by(Player.nick).\\r
group_by(Player.player_id).all()[0:10]\r
seq = Sequence('player_game_stats_player_game_stat_id_seq')\r
pgstat_id = session.execute(seq)\r
pgstat = PlayerGameStat(player_game_stat_id=pgstat_id, \r
- create_dt=datetime.datetime.now())\r
+ create_dt=datetime.datetime.utcnow())\r
\r
# set player id from player record\r
pgstat.player_id = player.player_id\r