Пример #1
0
 def testCount(self):
     for x in range(0, 1110):
         Error().save(dont_send_signals=True)
     assert count() == 1110
     for x in range(0, 5):
         err = Error(dont_send_signals=True)
         err.priority = 4
         err.save()
     assert count(["priority = ", 4]) == 5
     assert count(["priority = ", None]) == 1110
     assert count() == 1115
Пример #2
0
def get_status(stats):
    return {
        "500":count(["status = ", "500"], ["timestamp_date = ", stats.date]),
        "404":count(["status = ", "404"], ["timestamp_date = ", stats.date]),
        "403":count(["status = ", "403"], ["timestamp_date = ", stats.date]),
    }
Пример #3
0
def get_total(stats):
    return count(["timestamp_date = ", stats.date],)