Mercurial > public > sg101
view gpp/core/models.py @ 501:0ac39f006eb2
For #240, tweaked the Javascript to be able to submit the form when enter is typed.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 03 Dec 2011 03:14:13 +0000 |
parents | 3fe60148f75c |
children |
line wrap: on
line source
""" This file contains the core Models used in gpp """ import datetime from django.db import models from django.contrib.auth.models import User class Statistic(models.Model): """ This model keeps track of site statistics. Currently, the only statistic is the maximum number of users online. This stat is computed by a mgmt. command that is run on a cron job to peek at the previous two models. """ max_users = models.IntegerField() max_users_date = models.DateTimeField() max_anon_users = models.IntegerField() max_anon_users_date = models.DateTimeField() def __unicode__(self): return u'%d users on %s' % (self.max_users, self.max_users_date.strftime('%Y-%m-%d %H:%M:%S'))