Exemplo n.º 1
0
def home():
    if 'user' in session:
        titles = db.getEntryTitle(session['user'])
        entries = db.getEntryBody(session['user'])

        titles = [x[0] for x in titles if x[0] != "CREATED"]
        entries = [x[0] for x in entries if x[0] != "CREATED"]

        return render_template('return.html', titles=titles, entries=entries)
    return render_template('form.html')
Exemplo n.º 2
0
def search():
    user = request.args['user']
    if db.isUser(user) == True:
        print("ok")
        titles = db.getEntryTitle(user)
        entries = db.getEntryBody(user)

        titles=[x[0] for x in titles if x[0] != "CREATED"]
        entries=[x[0] for x in entries if x[0] != "CREATED"]

        return render_template("search.html", user=user, titles=titles, entries=entries)
    else: #Error handling
        flash("Username not found! Returned back to your page")
        return redirect("/")