python,python-2.7,flask,wtforms,wtforms-json
I was being an utter retard and used the from_json()-function wrong, as it is a class-function that returns an instantiated form. See updated code for route below. @app.route('/', methods=['POST']) def why_no_work(): form = User.from_json(request.json) # <-- This line right here if form.validate(): return jsonify(success='YEAH') else: return jsonify(errors=form.errors) ...
ajax,flask,wtforms,flask-wtforms,wtforms-json
Option # 1 is the best option considering the scenarios you have explained. There should not be any problems in re-directing the user to form validation page as you can manage it through XHR. Here is what I can suggest @catalog.route('/') @catalog.route('/your_page') def home(): if request.is_xhr: ## Here you can...