From 7bf746370584b9f04d45f93f93965fa0eb073fc2 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 11 Jul 2010 05:28:43 +0200 Subject: [PATCH] TPS displays currency and fee now --- pyfpdb/GuiTourneyPlayerStats.py | 26 ++++++++++++++------------ pyfpdb/SQL.py | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiTourneyPlayerStats.py b/pyfpdb/GuiTourneyPlayerStats.py index 105ed880..e3ce2691 100644 --- a/pyfpdb/GuiTourneyPlayerStats.py +++ b/pyfpdb/GuiTourneyPlayerStats.py @@ -75,19 +75,21 @@ class GuiTourneyPlayerStats (threading.Thread): # ToDo: create popup to adjust column config # columns to display, keys match column name returned by sql, values in tuple are: # is column displayed, column heading, xalignment, formatting, celltype - self.columns = [ ["siteName", True, "Site", 0.0, "%s", "str"] - #, ["tourney", False, "Tourney", 0.0, "%s", "str"] # true not allowed for this line - , ["buyIn", True, "BuyIn", 1.0, "%3.2f", "str"] - , ["playerName", False, "Name", 0.0, "%s", "str"] # true not allowed for this line (set in code) - , ["tourneyCount", True, "#", 1.0, "%1.0f", "str"] - , ["itm", True, "ITM%", 1.0, "%3.2f", "str"] - , ["1st", False, "1st", 1.0, "%1.0f", "str"] + self.columns = [ ["siteName", True, "Site", 0.0, "%s", "str"] + #,["tourney", False, "Tourney", 0.0, "%s", "str"] # true not allowed for this line + , ["currency", True, "Curr.", 0.0, "%s", "str"] + , ["buyIn", True, "BuyIn", 1.0, "%3.2f", "str"] + , ["fee", True, "Fee", 1.0, "%3.2f", "str"] + , ["playerName", False, "Name", 0.0, "%s", "str"] # true not allowed for this line (set in code) + , ["tourneyCount", True, "#", 1.0, "%1.0f", "str"] + , ["itm", True, "ITM%", 1.0, "%3.2f", "str"] + , ["1st", False, "1st", 1.0, "%1.0f", "str"] , ["2nd", True, "2nd", 1.0, "%1.0f", "str"] - , ["3rd", True, "3rd", 1.0, "%1.0f", "str"] - , ["unknownRank", True, "unknown", 1.0, "%1.0f", "str"] - , ["spent", True, "Spent", 1.0, "%3.2f", "str"] - , ["won", True, "Won", 1.0, "%3.2f", "str"] - , ["roi", True, "ROI%", 1.0, "%3.0f", "str"]] + , ["3rd", True, "3rd", 1.0, "%1.0f", "str"] + , ["unknownRank", True, "Rank?", 1.0, "%1.0f", "str"] + , ["spent", True, "Spent", 1.0, "%3.2f", "str"] + , ["won", True, "Won", 1.0, "%3.2f", "str"] + , ["roi", True, "ROI%", 1.0, "%3.0f", "str"]] self.stats_frame = gtk.Frame() self.stats_frame.show() diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 9f9747b8..0588f2de 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2261,7 +2261,9 @@ class Sql: self.query['tourneyPlayerDetailedStats'] = """ select s.name AS siteName ,t.tourneyTypeId AS tourneyTypeId + ,tt.currency AS currency ,(CASE WHEN tt.currency = "USD" THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn + ,tt.fee/100.0 AS fee ,p.name AS playerName ,COUNT(1) AS tourneyCount ,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank