Mercurial > public > sg101
annotate gpp/core/models.py @ 481:9f888dbe61ce
Fixing #230; add a scrollbar to the PM popup dialog if necessary. This wasn't as easy as I thought. Had to wrap the PM text in a div with its styling (max-height and overflow). If I then resized the dialog, I'd get two scrollbars. So for now, made the dialog non-resizable.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 07 Oct 2011 02:11:33 +0000 |
parents | 3fe60148f75c |
children |
rev | line source |
---|---|
gremmie@1 | 1 """ |
bgneal@37 | 2 This file contains the core Models used in gpp |
gremmie@1 | 3 """ |
bgneal@239 | 4 import datetime |
bgneal@239 | 5 |
bgneal@227 | 6 from django.db import models |
bgneal@239 | 7 from django.contrib.auth.models import User |
gremmie@1 | 8 |
bgneal@227 | 9 |
bgneal@239 | 10 class Statistic(models.Model): |
bgneal@239 | 11 """ |
bgneal@239 | 12 This model keeps track of site statistics. Currently, the only statistic |
bgneal@239 | 13 is the maximum number of users online. This stat is computed by a mgmt. |
bgneal@239 | 14 command that is run on a cron job to peek at the previous two models. |
bgneal@239 | 15 """ |
bgneal@239 | 16 max_users = models.IntegerField() |
bgneal@239 | 17 max_users_date = models.DateTimeField() |
bgneal@239 | 18 max_anon_users = models.IntegerField() |
bgneal@239 | 19 max_anon_users_date = models.DateTimeField() |
bgneal@239 | 20 |
bgneal@239 | 21 def __unicode__(self): |
bgneal@423 | 22 return u'%d users on %s' % (self.max_users, |
bgneal@239 | 23 self.max_users_date.strftime('%Y-%m-%d %H:%M:%S')) |
bgneal@239 | 24 |