about summary refs log tree commit diff
path: root/uploader/genotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/genotypes')
-rw-r--r--uploader/genotypes/views.py22
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")