Mercurial > public > sg101
comparison gpp/forums/models.py @ 414:b1f939b1fb01
Fixing #204; added the ability to search on forum topics.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 19:20:12 +0000 |
parents | 42a4e66972d5 |
children | c8148cf11a79 |
comparison
equal
deleted
inserted
replaced
413:6144023ebea8 | 414:b1f939b1fb01 |
---|---|
257 self.last_post = \ | 257 self.last_post = \ |
258 Post.objects.filter(topic=self).exclude(pk=self.last_post.pk).latest() | 258 Post.objects.filter(topic=self).exclude(pk=self.last_post.pk).latest() |
259 except Post.DoesNotExist: | 259 except Post.DoesNotExist: |
260 self.last_post = None | 260 self.last_post = None |
261 | 261 |
262 def search_title(self): | |
263 return u"%s by %s" % (self.name, self.user.username) | |
264 | |
265 def search_summary(self): | |
266 return u'' | |
267 | |
262 | 268 |
263 class Post(models.Model): | 269 class Post(models.Model): |
264 """ | 270 """ |
265 A post is an instance of a user's single contribution to a topic. | 271 A post is an instance of a user's single contribution to a topic. |
266 """ | 272 """ |