示例#1
0
文件: routes.py 项目: ilkut/baseFlask
def notes():
    notes = Note.query.all()
    form = NoteForm()
    if form.validate_on_submit():
        note = Note(body=form.note.data, author=current_user)
        db.session.add(note)
        db.session.commit()
        flash('Note saved.')
        return redirect('/notes')
    printThis = 'string'
    return render_template('notes.html',
                           title=('Home'),
                           notes=notes,
                           form=form)