summaryrefslogtreecommitdiff
path: root/jfr_playoff/db.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-10-03 16:20:22 +0200
committeremkael <emkael@tlen.pl>2017-10-03 16:20:22 +0200
commit37df04c91788d023681c8a7015b9807764974a1d (patch)
tree0b5c108681b5ea222e2c6d0f7358b372c893f885 /jfr_playoff/db.py
parent31f3d7ed154c24ffd9c84448effb1d87b7456ade (diff)
Ability to classify teams from specified position according to sepatare tournament results
Diffstat (limited to 'jfr_playoff/db.py')
-rw-r--r--jfr_playoff/db.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/jfr_playoff/db.py b/jfr_playoff/db.py
index b94f3d5..ad32ac8 100644
--- a/jfr_playoff/db.py
+++ b/jfr_playoff/db.py
@@ -16,7 +16,15 @@ class PlayoffDB(object):
def get_cursor(self):
return self.db_cursor
- def fetch(self, db_name, sql, params):
+ def __execute_query(self, db_name, sql, params):
self.db_cursor.execute(sql.replace('#db#', db_name), params)
+
+ def fetch(self, db_name, sql, params):
+ self.__execute_query(db_name, sql, params)
row = self.db_cursor.fetchone()
return row
+
+ def fetch_all(self, db_name, sql, params):
+ self.__execute_query(db_name, sql, params)
+ results = self.db_cursor.fetchall()
+ return results