added TourneyTypeCount to DB Stats window

This commit is contained in:
steffen123 2010-07-10 19:39:05 +02:00
parent ec0db8b7cc
commit ca61189706
3 changed files with 11 additions and 2 deletions

View File

@ -565,6 +565,12 @@ class Database:
return c.fetchone()[0] return c.fetchone()[0]
#end def getTourneyCount #end def getTourneyCount
def getTourneyTypeCount(self):
c = self.connection.cursor()
c.execute(self.sql.query['getTourneyTypeCount'])
return c.fetchone()[0]
#end def getTourneyCount
def get_actual_seat(self, hand_id, name): def get_actual_seat(self, hand_id, name):
c = self.connection.cursor() c = self.connection.cursor()
c.execute(self.sql.query['get_actual_seat'], (hand_id, name)) c.execute(self.sql.query['get_actual_seat'], (hand_id, name))

View File

@ -3840,8 +3840,8 @@ class Sql:
# Counts for DB stats window # Counts for DB stats window
################################ ################################
self.query['getHandCount'] = "SELECT COUNT(id) FROM Hands" self.query['getHandCount'] = "SELECT COUNT(id) FROM Hands"
self.query['getTourneyCount'] = "SELECT COUNT(id) FROM Tourneys" self.query['getTourneyCount'] = "SELECT COUNT(id) FROM Tourneys"
self.query['getTourneyTypeCount'] = "SELECT COUNT(id) FROM TourneyTypes"
################################ ################################
# placeholders and substitution stuff # placeholders and substitution stuff

View File

@ -323,7 +323,10 @@ class fpdb:
+ "other windows have been opened. Re-start fpdb to use this option.") + "other windows have been opened. Re-start fpdb to use this option.")
def dia_database_stats(self, widget, data=None): def dia_database_stats(self, widget, data=None):
self.warning_box(str="Number of hands: "+str(self.db.getHandCount())+"\nNumber of tourneys: "+str(self.db.getTourneyCount()), diatitle="Database Statistics") self.warning_box(str="Number of Hands: "+str(self.db.getHandCount())+
"\nNumber of Tourneys: "+str(self.db.getTourneyCount())+
"\nNumber of TourneyTypes: "+str(self.db.getTourneyTypeCount()),
diatitle="Database Statistics")
#end def dia_database_stats #end def dia_database_stats
# def dia_get_db_root_credentials(self): # def dia_get_db_root_credentials(self):