Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
596:cc39f34ce12b | 597:7d005ebd8deb |
---|---|
325 def touch(self): | 325 def touch(self): |
326 """Call this function to indicate the post has been edited.""" | 326 """Call this function to indicate the post has been edited.""" |
327 self.update_date = datetime.datetime.now() | 327 self.update_date = datetime.datetime.now() |
328 | 328 |
329 def search_title(self): | 329 def search_title(self): |
330 return u"%s by %s" % (self.topic.name, self.user.username) | 330 return u"%s by %s (%s)" % (self.topic.name, self.user.username, |
331 self.creation_date.strftime('%d-%b-%Y')) | |
331 | 332 |
332 def search_summary(self): | 333 def search_summary(self): |
333 return self.body | 334 return self.body |
334 | 335 |
335 | 336 |