fix refs to reviewHistory's id

This commit is contained in:
Damien Elmes 2009-03-15 06:43:45 +09:00
parent 66cda18a69
commit a111537c26

View file

@ -437,7 +437,7 @@ and priority > 0""", cutoff=cutoff) or 0) / float(period)
def getPastWorkloadPeriod(self, period): def getPastWorkloadPeriod(self, period):
cutoff = time.time() - 86400 * period cutoff = time.time() - 86400 * period
return (self.deck.s.scalar(""" return (self.deck.s.scalar("""
select count(id) from reviewHistory select count(*) from reviewHistory
where time > :cutoff""", cutoff=cutoff) or 0) / float(period) where time > :cutoff""", cutoff=cutoff) or 0) / float(period)
def getNewPeriod(self, period): def getNewPeriod(self, period):
@ -449,7 +449,7 @@ where created > :cutoff""", cutoff=cutoff) or 0)
def getFirstPeriod(self, period): def getFirstPeriod(self, period):
cutoff = time.time() - 86400 * period cutoff = time.time() - 86400 * period
return (self.deck.s.scalar(""" return (self.deck.s.scalar("""
select count(id) from reviewHistory select count(*) from reviewHistory
where reps = 1 and time > :cutoff""", cutoff=cutoff) or 0) where reps = 1 and time > :cutoff""", cutoff=cutoff) or 0)
# Kanji stats # Kanji stats