added DataStore.getProjects()
This commit is contained in:
parent
757f325ae9
commit
8f6345d478
13
DataStore.py
13
DataStore.py
@ -39,3 +39,16 @@ CREATE TABLE hours (
|
||||
conn.commit()
|
||||
c.close()
|
||||
conn.close()
|
||||
|
||||
def getProjects(self):
|
||||
c = self.conn.cursor()
|
||||
c.execute('''
|
||||
SELECT id, name
|
||||
FROM projects
|
||||
''')
|
||||
projects = {}
|
||||
for row in c:
|
||||
projects[row[0]] = row[1]
|
||||
c.close()
|
||||
self.conn.commit()
|
||||
return projects
|
||||
|
Loading…
x
Reference in New Issue
Block a user