Skip to content
Myr

views.py

This file

Path

examples/javascript/js_example/views.py

18 lines · 449 bytes · Python

Last changed by

Merge pull request #3246 from pallets/reorder-importsDavid Lordbefore adoption3db4697

History of this file

Take it

The walk stopped after 200 commits: lines older than 3a0ea72 point at it.

Merge pull request #3246 from pallets/reorder-importsDavid Lordbefore adoption3db4697

lines 1–3why, one step back
1from flask import jsonify
2from flask import render_template3from flask import request

move coveragerc to setup.cfgDavid Lordbefore adoption3a0ea72

lines 4–7why, one step back
4
5from js_example import app67

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

lines 8–9why, one step back
8@app.route("/", defaults={"js": "plain"})
9@app.route("/<any(plain, jquery, fetch):js>")

move coveragerc to setup.cfgDavid Lordbefore adoption3a0ea72

line 10why, one step back
10def index(js):

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 11why, one step back
11 return render_template("{0}.html".format(js), js=js)

move coveragerc to setup.cfgDavid Lordbefore adoption3a0ea72

lines 12–13why, one step back
12
13

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 14why, one step back
14@app.route("/add", methods=["POST"])

move coveragerc to setup.cfgDavid Lordbefore adoption3a0ea72

line 15why, one step back
15def add():

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

lines 16–17why, one step back
16 a = request.form.get("a", 0, type=float)
17 b = request.form.get("b", 0, type=float)

move coveragerc to setup.cfgDavid Lordbefore adoption3a0ea72

line 18why, one step back
18 return jsonify(result=a + b)