comparison gpp/bio/models.py @ 223:cd4124b19196

For #51; add user profiles to Haystack search.
author Brian Neal <bgneal@gmail.com>
date Mon, 07 Jun 2010 03:37:36 +0000
parents 8c1832b9d815
children 75ea1a8be7f2
comparison
equal deleted inserted replaced
222:a5fcf3d1b663 223:cd4124b19196
125 """ 125 """
126 return self.user.is_active 126 return self.user.is_active
127 user_is_active.boolean = True 127 user_is_active.boolean = True
128 user_is_active.short_description = "Is Active" 128 user_is_active.short_description = "Is Active"
129 129
130 def search_title(self):
131 full_name = self.user.get_full_name()
132 if full_name:
133 return u"%s (%s)" % (self.user.username, full_name)
134 return self.user.username
135
136 def search_summary(self):
137 return u"\n".join((self.location, self.occupation, self.interests,
138 self.profile_text, self.signature))
139
130 140
131 class UserProfileFlag(models.Model): 141 class UserProfileFlag(models.Model):
132 """This model represents a user flagging a profile as inappropriate.""" 142 """This model represents a user flagging a profile as inappropriate."""
133 user = models.ForeignKey(auth.models.User) 143 user = models.ForeignKey(auth.models.User)
134 profile = models.ForeignKey(UserProfile) 144 profile = models.ForeignKey(UserProfile)