Mercurial > public > sg101
comparison gpp/forums/models.py @ 222:a5fcf3d1b663
For #51; add forums to Haystack search.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 06 Jun 2010 21:05:48 +0000 |
parents | 500e5875a306 |
children | 405468b8e3b9 |
comparison
equal
deleted
inserted
replaced
221:8d13baeaa5c1 | 222:a5fcf3d1b663 |
---|---|
279 | 279 |
280 def touch(self): | 280 def touch(self): |
281 """Call this function to indicate the post has been edited.""" | 281 """Call this function to indicate the post has been edited.""" |
282 self.update_date = datetime.datetime.now() | 282 self.update_date = datetime.datetime.now() |
283 | 283 |
284 def search_title(self): | |
285 return u"%s by %s" % (self.topic.name, self.user.username) | |
286 | |
287 def search_summary(self): | |
288 return self.body | |
289 | |
284 | 290 |
285 class FlaggedPost(models.Model): | 291 class FlaggedPost(models.Model): |
286 """This model represents a user flagging a post as inappropriate.""" | 292 """This model represents a user flagging a post as inappropriate.""" |
287 user = models.ForeignKey(User) | 293 user = models.ForeignKey(User) |
288 post = models.ForeignKey(Post) | 294 post = models.ForeignKey(Post) |