AƱadido sistema de instalaciĆ³n
[ttt.git] / tttdb.py
1 # Author: Daniel Garcia <dani@danigm.net>
2 # License: GPLv3
3
4 from sqlobject import *
5 import os
6
7 class Tracker(SQLObject):
8     project = StringCol()
9     task = StringCol()
10     ticket = IntCol()
11     start = DateTimeCol()
12     end = DateTimeCol()
13
14 def get_hub():
15     connection_string = 'sqlite://%s/devdata.sqlite' % os.getcwd()
16     connection = connectionForURI(connection_string)
17     sqlhub.processConnection = connection
18
19     return sqlhub
20
21 def create_db():
22     # You need to create the database before.
23     sqlhub = get_hub()
24
25     Tracker.createTable()