view core/models.py @ 591:1982996ce365

Created a "fixed page" facility. Reworked the last few commits. We now generate HTML snippets from restructured text files. These are {% include'd %} by a fixed page template. This is for bitbucket issue #8.
author Brian Neal <bgneal@gmail.com>
date Sat, 12 May 2012 14:57:45 -0500
parents ee87ea74d46b
children 2f5779e9d8f8
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'))