Child: [6702bc] (diff)

Download this file

site_stats.py    11 lines (6 with data), 267 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from datetime import datetime, timedelta
from bson import ObjectId
from . import model as TM
def tickets_stats_24hr():
window = datetime.utcnow() - timedelta(hours=24)
return TM.Ticket.query.find({'_id': {'$gte': ObjectId.from_datetime(window)}}).count()