Ejemplo n.º 1
0
def show_comments_of_post(post_id):

    post = Post.get(post_id)

    _comments = ""

    for comment in post.comments:
        _comments += "<li>" + \
                        "<div id='comment_box'>" + \
                            "<a id='comment_author' href='/user/"+comment["user"]+"'>" + \
                                comment["user"] + \
                            "</a>" + \
                            "<p id='comment_text'>" + \
                                comment["comment_text"] + \
                            "</p>" + \
                        "</div>" + \
                    "</li>"

    comment_list = "<ul id='comment_list'>" + _comments + "</ul>"

    return comment_list + render_template("comments.html")
Ejemplo n.º 2
0
def show_comments_of_post(post_id):

    post = Post.get(post_id)

    _comments = ""

    for comment in post.comments:
        _comments += "<li>" + \
                        "<div id='comment_box'>" + \
                            "<a id='comment_author' href='/user/"+comment["user"]+"'>" + \
                                comment["user"] + \
                            "</a>" + \
                            "<p id='comment_text'>" + \
                                comment["comment_text"] + \
                            "</p>" + \
                        "</div>" + \
                    "</li>"

    comment_list = "<ul id='comment_list'>" + _comments + "</ul>"

    return comment_list + render_template("comments.html")
Ejemplo n.º 3
0
def count_comments(post_id):
    post = Post.get(post_id)

    return len(post.comments)
Ejemplo n.º 4
0
def count_comments(post_id):
    post = Post.get(post_id)

    return len(post.comments)