add DataStore.getTasks()

This commit is contained in:
Josh Holtrop 2011-02-15 19:37:55 -05:00
parent 8f6345d478
commit 951bf59dab

View File

@ -52,3 +52,17 @@ FROM projects
c.close()
self.conn.commit()
return projects
def getTasks(self, projectid):
c = self.conn.cursor()
c.execute('''
SELECT id, name
FROM tasks
WHERE projectid = ?
''' % (projectid,))
tasks = {}
for row in c:
tasks[row[0]] = row[1]
c.close()
self.conn.commit()
return tasks