Mercurial > public > sg101
comparison forums/models.py @ 598:2e429e2b7bb6
For issue #15; add date info to forum search results.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 13 Jun 2012 20:46:30 -0500 |
parents | 7d005ebd8deb |
children | 71a671dab55d |
comparison
equal
deleted
inserted
replaced
597:7d005ebd8deb | 598:2e429e2b7bb6 |
---|---|
245 except Post.DoesNotExist: | 245 except Post.DoesNotExist: |
246 self.last_post = None | 246 self.last_post = None |
247 | 247 |
248 def search_title(self): | 248 def search_title(self): |
249 if self.post_count == 1: | 249 if self.post_count == 1: |
250 post_text = "(1 post)" | 250 post_text = "1 post" |
251 else: | 251 else: |
252 post_text = "(%d posts)" % self.post_count | 252 post_text = "%d posts" % self.post_count |
253 | 253 |
254 return u"%s by %s; %s" % (self.name, self.user.username, post_text) | 254 return u"%s by %s; %s (%s)" % (self.name, self.user.username, post_text, |
255 self.creation_date.strftime('%d-%b-%Y')) | |
255 | 256 |
256 def search_summary(self): | 257 def search_summary(self): |
257 return u'' | 258 return u'' |
258 | 259 |
259 def ogp_tags(self): | 260 def ogp_tags(self): |