Child: [6702bc] (diff)

Download this file

site_stats.py    9 lines (5 with data), 217 Bytes

1
2
3
4
5
6
7
8
from datetime import datetime, timedelta
from . import model as DM
def posts_24hr():
window = datetime.utcnow() - timedelta(hours=24)
return DM.ForumPost.query.find({'timestamp': {'$gte': window}}).count()