From 15289ced90dbecaaa710318ccfcf8b002e3121c6 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 5 Jan 2024 13:13:39 +0300 Subject: UI to select the population under which the data falls. --- qc_app/upload/rqtl2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'qc_app/upload') diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index e54f141..06edfee 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -29,3 +29,20 @@ def select_species(): "upload.rqtl2.select_population", species_id=species_id)) flash("Invalid species or no species selected!", "alert-error error-rqtl2") return redirect(url_for("upload.rqtl2.select_species")) + +@rqtl2.route("/upload/species//select-population", + methods=["GET", "POST"]) +def select_population(species_id: int): + """Select/Create the population to organise data under.""" + species = with_db_connection(lambda conn: species_by_id(conn, species_id)) + if not bool(species): + flash("Invalid species selected!", "alert-error error-rqtl2") + return redirect(url_for("upload.rqtl2.select_species")) + + if request.method == "GET": + return render_template( + "rqtl2/select-population.html", + species=species, + populations=groups_by_species(species_id)) + + return "WOULD PROCESS DATA" -- cgit v1.2.3