diff 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
line wrap: on
line diff
--- a/gpp/forums/models.py	Sun Jun 06 20:19:10 2010 +0000
+++ b/gpp/forums/models.py	Sun Jun 06 21:05:48 2010 +0000
@@ -281,6 +281,12 @@
         """Call this function to indicate the post has been edited."""
         self.update_date = datetime.datetime.now()
 
+    def search_title(self):
+        return u"%s by %s" % (self.topic.name, self.user.username)
+
+    def search_summary(self):
+        return self.body
+
 
 class FlaggedPost(models.Model):
     """This model represents a user flagging a post as inappropriate."""