From 627c044b6fdcd0679de005de17adfda698056112 Mon Sep 17 00:00:00 2001 From: Worros Date: Mon, 12 Jul 2010 18:19:01 +1000 Subject: [PATCH 1/2] Fix grapher so that only cash limits show up --- pyfpdb/RingFilters.py | 2 +- pyfpdb/SQL.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pyfpdb/RingFilters.py b/pyfpdb/RingFilters.py index be4aba43..db7ed4de 100644 --- a/pyfpdb/RingFilters.py +++ b/pyfpdb/RingFilters.py @@ -624,7 +624,7 @@ class RingFilters(Filters.Filters): vbox.pack_start(vbox1, False, False, 0) self.boxes['limits'] = vbox1 - self.cursor.execute(self.sql.query['getLimits3']) + self.cursor.execute(self.sql.query['getCashLimits']) # selects limitType, bigBlind result = self.db.cursor.fetchall() found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False} diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index a1eec221..26d5dc6b 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -1986,13 +1986,18 @@ class Sql: ORDER by type, limitType DESC, bigBlind DESC""" self.query['getLimits3'] = """select DISTINCT type , gt.limitType - , case type + , case type when 'ring' then bigBlind - else buyin - end as bb_or_buyin +- else buyin +- end as bb_or_buyin from Gametypes gt cross join TourneyTypes tt order by type, limitType DESC, bb_or_buyin DESC""" + self.query['getCashLimits'] = """select DISTINCT type + , limitType + , bigBlind as bb_or_buyin + from Gametypes gt + order by type, limitType DESC, bb_or_buyin DESC""" if db_server == 'mysql': self.query['playerDetailedStats'] = """ From 585fd2feb2652d40895bdf67e9fa9d8e217b7450 Mon Sep 17 00:00:00 2001 From: Worros Date: Mon, 12 Jul 2010 18:41:28 +1000 Subject: [PATCH 2/2] Update graph and session queries to identify ring games --- pyfpdb/SQL.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 26d5dc6b..e2a72bf5 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2826,7 +2826,7 @@ class Sql: AND h.startTime < '' - AND hp.tourneysPlayersId IS NULL + AND gt.type is 'ring' GROUP BY h.startTime, hp.handId, hp.sawShowdown, hp.totalProfit ORDER BY h.startTime""" @@ -2844,7 +2844,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND date_format(h.startTime, '%Y-%m-%d') - AND hp.tourneysPlayersId IS NULL + AND gt.type is 'ring' ORDER by time""" elif db_server == 'postgresql': self.query['sessionStats'] = """ @@ -2856,7 +2856,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND h.startTime - AND hp.tourneysPlayersId IS NULL + AND gt.type is 'ring' ORDER by time""" elif db_server == 'sqlite': self.query['sessionStats'] = """ @@ -2868,7 +2868,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND h.startTime - AND hp.tourneysPlayersId IS NULL + AND gt.type is 'ring' ORDER by time"""