From db6a8c5b31adbf665e52e95bbd71fb5fa856686e Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 19 Dec 2008 17:21:58 +0900 Subject: [PATCH] Grapher: Make date ranges work - MySQL --- pyfpdb/FpdbSQLQueries.py | 2 ++ pyfpdb/GuiGraphViewer.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/pyfpdb/FpdbSQLQueries.py b/pyfpdb/FpdbSQLQueries.py index 9afdc28f..4df2fa75 100644 --- a/pyfpdb/FpdbSQLQueries.py +++ b/pyfpdb/FpdbSQLQueries.py @@ -650,6 +650,8 @@ class FpdbSQLQueries: INNER JOIN HandsActions ha ON ha.handPlayerId = hp.id where pl.id in AND pl.siteId in + AND h.handStart > '' + AND h.handStart < '' AND hp.tourneysPlayersId IS NULL GROUP BY hp.handId, hp.winnings, h.handStart, hp.ante ORDER BY h.handStart""" diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index a0a2e326..ae8895ff 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -112,6 +112,12 @@ class GuiGraphViewer (threading.Thread): def getRingProfitGraph(self, names, sites): tmp = self.sql.query['getRingProfitAllHandsPlayerIdSite'] # print "DEBUG: getRingProfitGraph" + start_date, end_date = self.__get_dates() + + if start_date == '': + start_date = '1970-01-01' + if end_date == '': + end_date = '2020-12-12' #Buggered if I can find a way to do this 'nicely' take a list of intergers and longs # and turn it into a tuple readale by sql. @@ -125,6 +131,8 @@ class GuiGraphViewer (threading.Thread): #Must be a nicer way to deal with tuples of size 1 ie. (2,) - which makes sql barf tmp = tmp.replace("", nametest) tmp = tmp.replace("", sitetest) + tmp = tmp.replace("", start_date) + tmp = tmp.replace("", end_date) # print "DEBUG: sql query:" # print tmp