Mercurial > public > sg101
annotate 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 |
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 |
bgneal@227 | 5 from django.contrib import auth |
gremmie@1 | 6 |
bgneal@227 | 7 |
bgneal@227 | 8 class UserLastVisit(models.Model): |
bgneal@227 | 9 """ |
bgneal@227 | 10 This model represents timestamps indicating a user's last visit to the |
bgneal@227 | 11 site. |
bgneal@227 | 12 """ |
bgneal@227 | 13 user = models.ForeignKey(auth.models.User, unique=True) |
bgneal@227 | 14 last_visit = models.DateTimeField(db_index=True) |
bgneal@227 | 15 |
bgneal@227 | 16 |
bgneal@227 | 17 class AnonLastVisit(models.Model): |
bgneal@227 | 18 """ |
bgneal@227 | 19 This model represents timestamps for the last visit from non-authenticated |
bgneal@227 | 20 users. |
bgneal@227 | 21 """ |
bgneal@227 | 22 ip = models.CharField(max_length=16, db_index=True, unique=True) |
bgneal@227 | 23 last_visit = models.DateTimeField(db_index=True) |
bgneal@227 | 24 |