diff options
| author | Frederick Muriuki Muriithi | 2026-09-14 14:26:36 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-09-14 14:27:02 -0500 |
| commit | 34ea66fe406d9e71791e919515c00a0577a11ef4 (patch) | |
| tree | cc3793981e3c790cb6c25e3eefca15b123975a7f /uploader/genotypes/views.py | |
| parent | 479a5d51e02e022f025d65c0ac19cf5a7950ebe8 (diff) | |
| download | gn-uploader-34ea66fe406d9e71791e919515c00a0577a11ef4.tar.gz | |
Init "Add Genotypes Records" endpoint.
Diffstat (limited to 'uploader/genotypes/views.py')
| -rw-r--r-- | uploader/genotypes/views.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py index 1eaf0dd..648b38e 100644 --- a/uploader/genotypes/views.py +++ b/uploader/genotypes/views.py @@ -22,7 +22,7 @@ from uploader.authorisation import require_login from uploader.species.models import species_by_id from uploader.monadic_requests import make_either_error_handler from uploader.population.models import population_by_species_and_id -from uploader.request_checks import with_population +from uploader.request_checks import with_dataset, with_population from .models import (genotype_markers, @@ -212,3 +212,23 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= make_either_error_handler( "There was an error creating the genotype dataset."), __success__) + + +@genotypesbp.route( + "/<int:species_id>/populations/<int:population_id>/genotypes/datasets/" + "<int:dataset_id>/add-records", + methods=["GET", "POST"]) +@require_login +@with_population(species_redirect_uri="species.list_species", + redirect_uri="species.populations.list_species_populations") +@with_dataset(species_redirect_uri="species.list_species", + population_redirect_uri="species.populations.list_species_populations", + redirect_uri="species.populations.genotypes.index", + dataset_by_id=genotype_dataset) +def add_genotype_records(species: dict, population: dict, dataset: dict, **kwargs): + """Add new Genotype records to the dataset.""" + return render_template("genotypes/add-genotypes-records-csv.html", + species=species, + population=population, + dataset=dataset, + activelink="add-genotypes-records") |
