From 34ea66fe406d9e71791e919515c00a0577a11ef4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 14 Sep 2026 14:26:36 -0500 Subject: Init "Add Genotypes Records" endpoint. --- uploader/genotypes/views.py | 22 +++++++++++++++++++++- uploader/templates/genotypes/index.html | 7 +++++-- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'uploader') 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( + "//populations//genotypes/datasets/" + "/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") diff --git a/uploader/templates/genotypes/index.html b/uploader/templates/genotypes/index.html index 6becd23..1c3483d 100644 --- a/uploader/templates/genotypes/index.html +++ b/uploader/templates/genotypes/index.html @@ -17,8 +17,11 @@