comparison gpp/core/models.py @ 227:423c39ee44e0

Rework the who's online middleware and template tag for #87.
author Brian Neal <bgneal@gmail.com>
date Tue, 06 Jul 2010 03:02:20 +0000
parents 91fd31dc78fb
children dcc929973bba
comparison
equal deleted inserted replaced
226:405468b8e3b9 227:423c39ee44e0
1 """ 1 """
2 This file contains the core Models used in gpp 2 This file contains the core Models used in gpp
3 (None at this time).
4 """ 3 """
4 from django.db import models
5 from django.contrib import auth
5 6
7
8 class UserLastVisit(models.Model):
9 """
10 This model represents timestamps indicating a user's last visit to the
11 site.
12 """
13 user = models.ForeignKey(auth.models.User, unique=True)
14 last_visit = models.DateTimeField(db_index=True)
15
16
17 class AnonLastVisit(models.Model):
18 """
19 This model represents timestamps for the last visit from non-authenticated
20 users.
21 """
22 ip = models.CharField(max_length=16, db_index=True, unique=True)
23 last_visit = models.DateTimeField(db_index=True)
24