def get_context_data(self, **kwargs): context = super(Posts, self).get_context_data(**kwargs) context["title"] = FORUM_NAME context["category"] = "posts" context["forum_path"] = FORUM_PATH posts = PhpbbPosts.objects.order_by('-post_time')[:20] latest = [] for post in posts: latest.append(( get_username(post.poster_id).username, unquote(post.post_subject), phpbb_to_html(post.post_text), FORUM_PATH+"viewtopic.php?p=%s#p%s" % ( post.post_id, post.post_id), )) context["latest"] = latest return context
def get_context_data(self, **kwargs): context = super(Posts, self).get_context_data(**kwargs) context["title"] = FORUM_NAME context["category"] = "posts" context["forum_path"] = FORUM_PATH posts = PhpbbPosts.objects.order_by('-post_time')[:20] latest = [] for post in posts: latest.append(( get_username(post.poster_id).username, unquote(post.post_subject), phpbb_to_html(post.post_text), FORUM_PATH + "viewtopic.php?p=%s#p%s" % (post.post_id, post.post_id), )) context["latest"] = latest return context
def item_description(self, item): user = get_username(item.poster_id) username = user.username text = phpbb_to_html(item.post_text) return "[<b>%s</b>] %s " % (username, text)