comparison core/models.py @ 581:ee87ea74d46b

For Django 1.4, rearranged project structure for new manage.py.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 May 2012 17:10:48 -0500
parents gpp/core/models.py@3fe60148f75c
children 2f5779e9d8f8
comparison
equal deleted inserted replaced
580:c525f3e0b5d0 581:ee87ea74d46b
1 """
2 This file contains the core Models used in gpp
3 """
4 import datetime
5
6 from django.db import models
7 from django.contrib.auth.models import User
8
9
10 class Statistic(models.Model):
11 """
12 This model keeps track of site statistics. Currently, the only statistic
13 is the maximum number of users online. This stat is computed by a mgmt.
14 command that is run on a cron job to peek at the previous two models.
15 """
16 max_users = models.IntegerField()
17 max_users_date = models.DateTimeField()
18 max_anon_users = models.IntegerField()
19 max_anon_users_date = models.DateTimeField()
20
21 def __unicode__(self):
22 return u'%d users on %s' % (self.max_users,
23 self.max_users_date.strftime('%Y-%m-%d %H:%M:%S'))
24