Esempio n. 1
0
def render_comment_list(self, context):
    '''Render list of comments for given object'''
    obj = self.get_object(context)
    qs = Comment.all().filter("obj =", obj)
    return render_to_string("comments/block/comment_list",
                            {'comment_list': list(qs)},
                            context_instance = context)
Esempio n. 2
0
def get_comment_list(self, context):
    '''Get list of comments for given object'''
    obj = self.get_object(context)
    qs = Comment.all().filter("obj =", obj)
    context[self.varname] = list(qs)
    return ''
Esempio n. 3
0
def get_comment_count(self, context):
    '''Get total count of comments for given object'''
    obj = self.get_object(context)
    qs = Comment.all().filter("obj =", obj)
    context[self.varname] = qs.count()
    return ''