Exemple #1
0
 def populateTables(self):
     for d in self._durationList:
         with self._connection:
             _c = self._connection.cursor()
             _c.execute('INSERT INTO Durations VALUES (?,?)', (None, d.name))
             lastRowID = _c.lastrowid
         e = MultipleEventsSavingObject(d.events, self._filename, lastRowID)
         e.populateTables()
 def populateTables(self):
     with self._connection:
         self._populateRolesTables()
         self._populatePopulationTables()
         self._populateTimesTable()
     e = MultipleEventsSavingObject(self._institution.templates, self._filename, None)
     d = DurationSavingObject(self._institution.durations, self._filename)
     e.populateTables()
     d.populateTables()
Exemple #3
0
    def loadTables(self, institution, personCacheDict=None):

        listOfDurationTupples = []

        with self._connection:
            _c = self._connection.cursor()
            for row in _c.execute('SELECT * FROM Durations'):
                d = Duration(institution)
                d.name = row[1]
                listOfDurationTupples.append((row[0], d))

        e = MultipleEventsSavingObject([], self._filename, 0)

        for t in listOfDurationTupples:
            e.loadEvents(t[1], t[0], personCacheDict)
            institution.durations.append(t[1])