added DataStore.getProjects()
This commit is contained in:
1 parent
757f325ae9
commit
8f6345d478
1 file changed
+13
@@ -39,3 +39,16 @@ CREATE TABLE hours (
|
|||||||
conn.commit()
|
conn.commit()
|
||||||
c.close()
|
c.close()
|
||||||
conn.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
|
||||||
Reference in new issue
Block a user