Mercurial > public > sg101
annotate core/models.py @ 752:95f4e7f352fd
For Django 1.6: contrib auth password reset confirm view signature changed.
The uidb64 parameter was previously base 36 encoded and named uidb36.
Had to update urls.py. While I was in there I decided to make the
password reset email use the {% url %} tag to be more resilient if the
url changes.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 01 Jan 2014 19:52:07 -0600 |
parents | 2f5779e9d8f8 |
children |
rev | line source |
---|---|
gremmie@1 | 1 """ |
bgneal@37 | 2 This file contains the core Models used in gpp |
gremmie@1 | 3 """ |
bgneal@227 | 4 from django.db import models |
gremmie@1 | 5 |
bgneal@227 | 6 |
bgneal@239 | 7 class Statistic(models.Model): |
bgneal@239 | 8 """ |
bgneal@239 | 9 This model keeps track of site statistics. Currently, the only statistic |
bgneal@239 | 10 is the maximum number of users online. This stat is computed by a mgmt. |
bgneal@239 | 11 command that is run on a cron job to peek at the previous two models. |
bgneal@239 | 12 """ |
bgneal@239 | 13 max_users = models.IntegerField() |
bgneal@239 | 14 max_users_date = models.DateTimeField() |
bgneal@239 | 15 max_anon_users = models.IntegerField() |
bgneal@239 | 16 max_anon_users_date = models.DateTimeField() |
bgneal@239 | 17 |
bgneal@239 | 18 def __unicode__(self): |
bgneal@423 | 19 return u'%d users on %s' % (self.max_users, |
bgneal@239 | 20 self.max_users_date.strftime('%Y-%m-%d %H:%M:%S')) |
bgneal@239 | 21 |