Mercurial > public > sg101
comparison gpp/news/models.py @ 220:71fd8454688b
For #51, added weblinks to search. Decided against using the search index to store prerendered results. My fear is this could get too unweildy once we add forums.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 06 Jun 2010 20:06:15 +0000 |
parents | 6dbb8faef085 |
children | 405468b8e3b9 |
comparison
equal
deleted
inserted
replaced
219:26ee684c2033 | 220:71fd8454688b |
---|---|
73 | 73 |
74 def can_comment_on(self): | 74 def can_comment_on(self): |
75 now = datetime.datetime.now() | 75 now = datetime.datetime.now() |
76 delta = now - self.date_submitted | 76 delta = now - self.date_submitted |
77 return self.allow_comments and delta.days < 30 | 77 return self.allow_comments and delta.days < 30 |
78 | |
79 def search_title(self): | |
80 return self.title | |
81 | |
82 def search_summary(self): | |
83 return u"\n".join((self.short_text, self.long_text)) |