From 5461cb40361d238ee7088bdd79975eca8f9ad957 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 20 Jan 2022 14:18:27 +1100 Subject: [PATCH] improve /view naming --- TODO | 2 +- files.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index d8d2052..7294139 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ ## GENERAL * for below.. make Options( request ) - know that a view is a "path", dont rely on orig_url - - remove all "Options()" that are not set by a user-choice in the F/E and just make sure new "OPtions" sets all defaults as needed + - remove all "Options()" that are not set by a user-choice in the F/E and just make sure new "Options" sets all defaults as needed -- viewlist can work out new view_eids server side, and pass them back as json data - can consider an optim-- new_view page makes calls to viewlist to ADD json data only, so only trigger a new "viewlist" if we dont have data for that part of the eids diff --git a/files.py b/files.py index e54eaca..0bd356b 100644 --- a/files.py +++ b/files.py @@ -549,8 +549,8 @@ def viewlist(): return render_template("viewer.html", current=current, eids=eids, objs=objs, OPT=OPT ) @login_required -@app.route("/new_view/", methods=["GET"]) -def newview_img(id): +@app.route("/view/", methods=["GET"]) +def view(id): OPT=Options( request ) objs = {} print( OPT ) @@ -575,9 +575,9 @@ def newview_img(id): ################################################################################ @app.route("/view/", methods=["POST"]) @login_required -def view_img(id): +def view_img_post(id): OPT=Options( request ) - return redirect( "/new_view/" + id ); + return redirect( "/view/" + id ); # route called from front/end - if multiple images are being transformed, each transorm == a separate call # to this route (and therefore a separate transorm job. Each reponse allows the f/e to check the