def make_new_post(username): owner_id = model.get_user_by_name(username) author_id = model.get_user_by_name(session["username"]) created_at = datetime.now() content = request.form.get("wall_post") model.make_wall_post(owner_id, author_id, created_at, content) return redirect(url_for("view_user", username=username))
def post_to_wall(username): post_author = session.get("username") wall_text = request.form.get("wallText") wall_owner_id = model.get_user_by_name(username) post_author_id = model.get_user_by_name(post_author) model.make_wall_post(wall_owner_id, post_author_id, wall_text) return redirect(url_for("view_user", username=username))
def post_to_wall(username): model.connect_to_db() # this is a note of who is who owner_username = username # this is author that will be posting to the owners user wall author_user_id = session.get("username") new_post = request.form.get("post_content") model.make_wall_post(author_user_id, owner_username, new_post) return redirect("/user/" + username)
def post_to_wall(username): content = request.form.get("post") user_id = session['user_id'] return user_id model.make_wall_post(user_id, content) return redirect("/view_user/<username>")