def home(username):
    print("hello")
    if request.method == "POST":
        print("2")
        if(str(request.form["post"]) == "finding"):
            utils.addFriend(username, str(request.form["search_for"]))
        elif (str(request.form["post"])) == "commenting":
            print("1")
            print(str(request.form["id"]))
            print("3")
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("allfriends.html", theposts = utils.showFriendPosts(username), username = username, friendslist = utils.friendList(username), comments = utils.showAllComments())
Пример #2
0
def home(username):
    print("hello")
    if request.method == "POST":
        print("2")
        if(str(request.form["post"]) == "finding"):
            utils.addFriend(username, str(request.form["search_for"]))
        elif (str(request.form["post"])) == "commenting":
            print("1")
            print(str(request.form["id"]))
            print("3")
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("allfriends.html", theposts = utils.showFriendPosts(username), username = username, friendslist = utils.friendList(username), comments = utils.showAllComments())
def settings(username):
    print("1")
    if request.method == "POST":
        print("2")
        if (str(request.form["post"]) == "change"):
            print("3")
            the_response = utils.changePword(str(request.form["user"]), str(request.form["oldpass"]), str(request.form["pass1"]), str(request.form["pass2"]))
            return render_template("settings.html", username = username, the_response = the_response, friendslist = utils.friendList(username))
        elif (str(request.form["post"]) == "finding"):
            print("4")
            utils.addFriend(username, str(request.form["search_for"]))
            return render_template("settings.html", username = username, friendslist = utils.friendList(username))
    else:
        return render_template("settings.html", username = username, friendslist = utils.friendList(username))
Пример #4
0
def settings(username):
    print("1")
    if request.method == "POST":
        print("2")
        if (str(request.form["post"]) == "change"):
            print("3")
            the_response = utils.changePword(str(request.form["user"]), str(request.form["oldpass"]), str(request.form["pass1"]), str(request.form["pass2"]))
            return render_template("settings.html", username = username, the_response = the_response, friendslist = utils.friendList(username))
        elif (str(request.form["post"]) == "finding"):
            print("4")
            utils.addFriend(username, str(request.form["search_for"]))
            return render_template("settings.html", username = username, friendslist = utils.friendList(username))
    else:
        return render_template("settings.html", username = username, friendslist = utils.friendList(username))
def feed(username):
    print(request.method == "POST")
    if request.method == "POST":
        print("5")
        if(str(request.form["post"]) == "posted"):
            print("2")
            utils.addPost(username, str(request.form["title"]), "sub", str(request.form["paragraph_text"]))
        elif (str(request.form["post"])) == "finding":
            print(str(request.form["search_for"]))
            print("3")
            utils.addFriend(username, str(request.form["search_for"]))
            print(utils.isFriend(username, str(request.form["search_for"])))
        elif (str(request.form["post"])) == "commenting":
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("feed.html", comments = utils.showAllComments(), username = username, compareto = username,  posts = utils.showPosts(username), name = utils.findName(username), info = utils.showInfo(username), friendslist = utils.friendList(username))
Пример #6
0
def feed(username):
    print(request.method == "POST")
    if request.method == "POST":
        print("5")
        if(str(request.form["post"]) == "posted"):
            print("2")
            utils.addPost(username, str(request.form["title"]), "sub", str(request.form["paragraph_text"]))
        elif (str(request.form["post"])) == "finding":
            print(str(request.form["search_for"]))
            print("3")
            utils.addFriend(username, str(request.form["search_for"]))
            print(utils.isFriend(username, str(request.form["search_for"])))
        elif (str(request.form["post"])) == "commenting":
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("feed.html", comments = utils.showAllComments(), username = username, compareto = username,  posts = utils.showPosts(username), name = utils.findName(username), info = utils.showInfo(username), friendslist = utils.friendList(username))