diff gpp/forums/models.py @ 239:dcc929973bba

Fix the max users online statistic as per ticket #90.
author Brian Neal <bgneal@gmail.com>
date Sun, 12 Sep 2010 18:30:23 +0000
parents a46788862737
children d424b8bae71d
line wrap: on
line diff
--- a/gpp/forums/models.py	Sun Sep 12 04:04:42 2010 +0000
+++ b/gpp/forums/models.py	Sun Sep 12 18:30:23 2010 +0000
@@ -361,21 +361,3 @@
     def touch(self):
         self.last_visit = datetime.datetime.now()
 
-
-class Statistic(models.Model):
-    """
-    This model keeps track of forum 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 "users_online" dict
-    that is maintained in cache by the forums middleware.
-    """
-    max_users = models.IntegerField()
-    max_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'))
-
-    def save(self, *args, **kwargs):
-        self.max_users_date = datetime.datetime.now()
-        super(Statistic, self).save(*args, **kwargs)