def analyze_text():

    analyzed_text = ""
    text = request.form['entry']

    if (request.method == "POST"):
        analyzed_text = analyze(text)

    return render_template('analyze.html',
                           analyzed_text=analyzed_text,
                           text=text)
def populate():
    query = db.insert(Users).values(Username="******",
                                    fullName='grace',
                                    passwordHash="dfsfs34",
                                    Email="gracegmailcom")
    # db.session.execute( "INSERT INTO Users (Username, fullName, passwordHash, Email) VALUES ('glamalva', 'gracelamalva', 'adfa43', 'glamalvagmailcom')")
    analyzed_text = analyze(text)

    return render_template('analyze.html',
                           analyzed_text=analyzed_text,
                           text=text)
def analyze_entry(EntryID):

    emotion = ""
    entry = JournalEntry.query.get(EntryID)

    if (request.method == "POST"):
        emotion = analyze(entry.EntryText)

        entry.EntryEmotion = emotion
        db.session.commit()

    entries = JournalEntry.query.all()

    return render_template('journal.html', entries=entries)