Esempio n. 1
0
def view_user(username):
    model.connect_to_db()
    owner_id = model.get_user_by_name(username)
    wallposts = model.get_wall_posts(owner_id)
    html = render_template("wall.html", wallposts=wallposts)
    # print "print in_view user fucntion"
    return html
Esempio n. 2
0
def view_user(username):
    model.connect_to_db()
    owner_id = model.get_user_by_name(username)
    wallposts = model.get_wall_posts(owner_id)
    html = render_template("wall.html", wallposts = wallposts)
    # print "print in_view user fucntion"
    return html
Esempio n. 3
0
def view_user(username):
    model.connect_to_db()
    user_id = model.get_user_by_name(username)
    posts = model.get_wall_posts(user_id[0])
    return render_template("wall.html", posts = posts,
                                        logged_in = session["user_id"],
                                        username = username)
Esempio n. 4
0
def user_wall(username):
    model.connect_to_db()
    user_id = model.get_userid_by_name(username)
    wall_posts = model.get_wall_posts(user_id)
    html = render_template("wall.html",
                           username=username,
                           wall_posts=wall_posts)
    return html
Esempio n. 5
0
def post_to_wall(username):
    model.connect_to_db()
    user_id = model.get_userid_by_name(username)
    wall_posts = model.get_wall_posts(user_id)
    author_id = model.get_userid_by_name(session.get("username"))
    wall_owner = username
    content = request.form.get("content")
    model.post_to_wall(wall_owner, author_id, content)
    return redirect(url_for("user_wall", username=username))
Esempio n. 6
0
def view_user(username):
    logged_in = False
    user_id = model.get_user_by_name(username)[0]
    if session.get("user_id"):
        logged_in = True

    if user_id != None:        
        wall_posts = model.get_wall_posts(user_id)
        if not wall_posts:
            return render_template("wall.html", message="This user has no posts.",
                                                logged_in=logged_in)
        else:
            return render_template("wall.html", posts=wall_posts,
                                                logged_in=logged_in)
            print wall_posts
    else:
        return render_template("wall.html", message="Not a valid user.")
Esempio n. 7
0
def view_user(username):
    logged_in = False
    user_id = model.get_user_by_name(username)[0]
    if session.get("user_id"):
        logged_in = True

    if user_id != None:
        wall_posts = model.get_wall_posts(user_id)
        if not wall_posts:
            return render_template("wall.html",
                                   message="This user has no posts.",
                                   logged_in=logged_in)
        else:
            return render_template("wall.html",
                                   posts=wall_posts,
                                   logged_in=logged_in)
            print wall_posts
    else:
        return render_template("wall.html", message="Not a valid user.")
Esempio n. 8
0
def view_user(username):
    user_id = (model.get_user_id(username))[0]
    row = model.get_wall_posts(user_id)
    return render_template("wall.html", posts = row, username=username)
Esempio n. 9
0
def view_user(username):
    user_id = model.get_user_by_name(username)
    wall_posts = model.get_wall_posts(user_id)
    return render_template("wall.html", wall_posts = wall_posts, session_id = session['username'], username = username)
Esempio n. 10
0
def view_user(username):
    model.connect_to_db()
    user_id = model.get_user_by_name(username)
    posts = model.get_wall_posts(user_id)
    return render_template("wall.html", the_posts=posts, username=username)