diff options
author | Frederick Muriuki Muriithi | 2024-10-10 16:18:52 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-10 16:30:43 -0500 |
commit | 4f994b79ecee851ea1cd0fa0699ee822c8884bc4 (patch) | |
tree | 5250f3a9b9b4a0b7fab8ae919167562b5048d654 /uploader/phenotypes/views.py | |
parent | 71b79a670cf59a517f9c0bc4f6f11894c2a5d44d (diff) | |
download | gn-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.py | 22 |
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...") |