Commit 4392f29536ad41d3328a408b5b3db08cd0c724f4
1 parent
398eafb8
Exists in
master
Update the Estimation Request persistence.
Also introduce the route we'll use for async computing.
Showing
1 changed file
with
11 additions
and
4 deletions
Show diff stats
flaskr/controllers/main_controller.py
... | ... | @@ -21,17 +21,16 @@ def estimate(): |
21 | 21 | |
22 | 22 | if form.validate_on_submit(): |
23 | 23 | |
24 | - # FIXME: do things here with the form | |
25 | - | |
26 | 24 | id = generate_unique_id() |
27 | 25 | |
28 | - # estimation = form.data | |
29 | - | |
30 | 26 | estimation = Estimation() |
31 | 27 | estimation.email = form.email.data |
32 | 28 | estimation.first_name = form.first_name.data |
33 | 29 | estimation.last_name = form.last_name.data |
34 | 30 | estimation.status = 'pending' |
31 | + estimation.origin_addresses = form.origin_addresses | |
32 | + estimation.destination_addresses = form.destination_addresses | |
33 | + estimation.compute_optimal_destination = form.compute_optimal_destination | |
35 | 34 | |
36 | 35 | db.session.add(estimation) |
37 | 36 | db.session.commit() |
... | ... | @@ -42,3 +41,11 @@ def estimate(): |
42 | 41 | |
43 | 42 | return render_template("estimate.html", form=form) |
44 | 43 | |
44 | + | |
45 | +@main.route("/compute") | |
46 | +def compute(): | |
47 | + response = "" | |
48 | + | |
49 | + # TODO | |
50 | + | |
51 | + return response | ... | ... |