def document_list(): form = DocumentForm() if form.validate_on_submit(): if current_user.is_authenticated: Document.add_document(title=form.title.data, body=form.body.data, user=current_user) else: flash("Please register or login to analyze documents.") documents = Document.get_all() return render_template("document-list.html", title="All documents", documents=documents)
def documents(): """documents Page""" query = Document.get_all() return render_template('main/documents.jinja2', documents=query)