aboutsummaryrefslogtreecommitdiff
path: root/uploader/phenotypes/views.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-10-10 16:18:52 -0500
committerFrederick Muriuki Muriithi2024-10-10 16:30:43 -0500
commit4f994b79ecee851ea1cd0fa0699ee822c8884bc4 (patch)
tree5250f3a9b9b4a0b7fab8ae919167562b5048d654 /uploader/phenotypes/views.py
parent71b79a670cf59a517f9c0bc4f6f11894c2a5d44d (diff)
downloadgn-uploader-4f994b79ecee851ea1cd0fa0699ee822c8884bc4.tar.gz
Build UI to add new phenotypes.
Build the UI and set up styling. This is not working currently.
Diffstat (limited to 'uploader/phenotypes/views.py')
-rw-r--r--uploader/phenotypes/views.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index ddf6908..eb0b460 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -286,3 +286,25 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable=
return redirect(url_for("species.populations.phenotypes.list_datasets",
species_id=species["SpeciesId"],
population_id=population["Id"]))
+
+
+@phenotypesbp.route(
+ "<int:species_id>/populations/<int:population_id>/phenotypes/datasets"
+ "/<int:dataset_id>/add-phenotypes",
+ methods=["GET", "POST"])
+@require_login
+@with_dataset(
+ species_redirect_uri="species.populations.phenotypes.index",
+ population_redirect_uri="species.populations.phenotypes.select_population",
+ redirect_uri="species.populations.phenotypes.list_datasets")
+def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs):
+ """Add one or more phenotypes to the dataset."""
+ with (database_connection(app.config["SQL_URI"]) as conn,
+ conn.cursor(cursorclass=DictCursor) as cursor):
+ if request.method == "GET":
+ return render_template("phenotypes/add-phenotypes.html",
+ species=species,
+ population=population,
+ dataset=dataset,
+ activelink="add-phenotypes")
+ raise NotImplementedError("Please implement this...")