Mercurial > public > sg101
comparison gpp/bio/models.py @ 259:75ea1a8be7f2
Fix some old import problems where I used 'from django.contrib import auth' instead of 'from django.contrib.auth.models import User'. Also some formatting changes while I was in there.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 21 Sep 2010 23:49:05 +0000 |
parents | cd4124b19196 |
children | d424b8bae71d |
comparison
equal
deleted
inserted
replaced
258:f9a9b4014d5b | 259:75ea1a8be7f2 |
---|---|
4 """ | 4 """ |
5 | 5 |
6 import os.path | 6 import os.path |
7 | 7 |
8 from django.db import models | 8 from django.db import models |
9 from django.contrib import auth | 9 from django.contrib.auth.models import User |
10 from django.conf import settings | 10 from django.conf import settings |
11 from django.core.cache import cache | 11 from django.core.cache import cache |
12 | 12 |
13 from core.markup import SiteMarkup | 13 from core.markup import SiteMarkup |
14 | 14 |
68 | 68 |
69 | 69 |
70 class UserProfile(models.Model): | 70 class UserProfile(models.Model): |
71 """model to represent additional information about users""" | 71 """model to represent additional information about users""" |
72 | 72 |
73 user = models.ForeignKey(auth.models.User, unique=True) | 73 user = models.ForeignKey(User, unique=True) |
74 location = models.CharField(max_length=128, blank=True) | 74 location = models.CharField(max_length=128, blank=True) |
75 birthday = models.DateField(blank=True, null=True, | 75 birthday = models.DateField(blank=True, null=True, |
76 help_text='Optional; the year is not shown to others') | 76 help_text='Optional; the year is not shown to others') |
77 occupation = models.CharField(max_length=128, blank=True) | 77 occupation = models.CharField(max_length=128, blank=True) |
78 interests = models.CharField(max_length=255, blank=True) | 78 interests = models.CharField(max_length=255, blank=True) |
138 self.profile_text, self.signature)) | 138 self.profile_text, self.signature)) |
139 | 139 |
140 | 140 |
141 class UserProfileFlag(models.Model): | 141 class UserProfileFlag(models.Model): |
142 """This model represents a user flagging a profile as inappropriate.""" | 142 """This model represents a user flagging a profile as inappropriate.""" |
143 user = models.ForeignKey(auth.models.User) | 143 user = models.ForeignKey(User) |
144 profile = models.ForeignKey(UserProfile) | 144 profile = models.ForeignKey(UserProfile) |
145 flag_date = models.DateTimeField(auto_now_add=True) | 145 flag_date = models.DateTimeField(auto_now_add=True) |
146 | 146 |
147 def __unicode__(self): | 147 def __unicode__(self): |
148 return u"%s's profile flagged by %s" % (self.profile.user.username, | 148 return u"%s's profile flagged by %s" % (self.profile.user.username, |