From 6e00ba9d78182f8cf21ac0a38c50f2fe50670da5 Mon Sep 17 00:00:00 2001 From: lastpoet Date: Tue, 12 Oct 2010 20:34:06 +0100 Subject: [PATCH] add date boundaries in filters --- pyfpdb/Filters.py | 1 + pyfpdb/SQL.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index ac62988f..1b07a67c 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -1062,6 +1062,7 @@ class Filters(threading.Thread): result = self.db.cursor.fetchall() t1 = result[0][0].split()[0] self.start_date.set_text(t1) + if t2 == '': self.cursor.execute(self.sql.query['get_last_date']) result = self.db.cursor.fetchall() diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index eef9ce04..d45ccd38 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -1396,6 +1396,10 @@ class Sql: , maxSeats, knockout, rebuy, addOn, speed, shootout, matrix, sng)""" self.query['get_last_hand'] = "select max(id) from Hands" + + self.query['get_last_date'] = "SELECT MAX(startTime) FROM Hands" + + self.query['get_first_date'] = "SELECT MIN(startTime) FROM Hands" self.query['get_player_id'] = """ select Players.id AS player_id