diff forums/models.py @ 597:7d005ebd8deb

For issue #15, add date information to forum search results.
author Brian Neal <bgneal@gmail.com>
date Mon, 11 Jun 2012 19:59:46 -0500
parents ee87ea74d46b
children 2e429e2b7bb6
line wrap: on
line diff
--- a/forums/models.py	Mon Jun 11 19:38:52 2012 -0500
+++ b/forums/models.py	Mon Jun 11 19:59:46 2012 -0500
@@ -327,7 +327,8 @@
         self.update_date = datetime.datetime.now()
 
     def search_title(self):
-        return u"%s by %s" % (self.topic.name, self.user.username)
+        return u"%s by %s (%s)" % (self.topic.name, self.user.username,
+                self.creation_date.strftime('%d-%b-%Y'))
 
     def search_summary(self):
         return self.body