diff options
| author | user <user@node5.net> | 2024-05-20 19:51:41 +0200 |
|---|---|---|
| committer | user <user@node5.net> | 2024-05-20 19:51:41 +0200 |
| commit | f0626b175d21230dc68ecd83e2726ec7e7daae5a (patch) | |
| tree | bee47010f3374fd53395f62a9067f4e41762c000 /src/shop_map_node5_net.py | |
| parent | 4c03c8e4514d40dff2a3736c7f04a89a7e21843a (diff) | |
user input categories, refactor, remove zombie code
Diffstat (limited to 'src/shop_map_node5_net.py')
| -rw-r--r-- | src/shop_map_node5_net.py | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/shop_map_node5_net.py b/src/shop_map_node5_net.py index 8ab97bc..3898e21 100644 --- a/src/shop_map_node5_net.py +++ b/src/shop_map_node5_net.py @@ -10,7 +10,7 @@ app = flask.Flask(__name__, template_folder='templates', static_folder='static', @app.route("/") def index(): - return flask.redirect('/index.html') + return flask.render_template('/index.html') @app.route("/chains") @@ -27,24 +27,15 @@ def chains(): return json.dumps(color_by_name) -@app.route("/stores.json") -def stores(): - return db_handler.get_stores() - - -@app.route("/supermarkets.json") -def supermarkets(): - return db_handler.get_supermarkets() - - -@app.route("/voronoi_polygons.json") -def voronoi_polygons(): - d = db_handler.voronoi_polygons() - +@app.route("/categories") +def categories(): + categories = db_handler.categories + return categories @app.route("/all.json") def all(): - rows = db_handler.get_all() + category_RADIOACTIVE = flask.request.args.get('Category') # User input is RADIOACTIVE + rows = db_handler.get_all(category_RADIOACTIVE) for row in rows: coordinates = [] for coordinate in json.loads(row['polygon'])['coordinates'][0]: |
