I am using mongoalchemy for the first time and it is proving a great tool. When I try to select objects from my database I cant get the value of those objects. This is my code as below (I am using it with flask):
class Password(db.Document):
password = db.StringField()
username = db.StringField()
system = db.StringField()
@app.route('/search_password', methods=['GET', 'POST'])
def search_password():
if request.method == 'GET':
session = db.session
passwords = session.query(Password)
password = passwords.first()
return render_template('search_for_passwords.html', passwords=password)
elif request.method == 'POST':
system = request.form['system']
So when I try to access the fields I cant because this is a document. So how do I get my fields back?