Add query_year()

This commit is contained in:
George Lacey 2016-09-23 22:11:04 +01:00
parent 5d299e7d82
commit de463b1aec

View File

@ -52,3 +52,7 @@ class Database(object):
def query(self, query):
return self.conn.execute(query).fetchall()
def query_year(self, table, year):
return self.query("""SELECT * FROM %s WHERE strftime(\"%%Y\",
START_TIME) == \"%s\"""" % (table, year))