From b74911f15a9f9a9ff3cca0e25fcd761bf41652b5 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 6 Sep 2024 16:38:04 -0500 Subject: Add more fields when creating a population Add more of the missing fields when creating a population, to ensure that the created population works as expected. --- uploader/population/views.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'uploader/population/views.py') diff --git a/uploader/population/views.py b/uploader/population/views.py index 84dffdb..5be19ae 100644 --- a/uploader/population/views.py +++ b/uploader/population/views.py @@ -18,7 +18,9 @@ from uploader.species.models import (all_species, order_species_by_family) from .models import (save_population, + population_families, populations_by_species, + population_genetic_types, population_by_species_and_id) __active_link__ = "populations" @@ -100,6 +102,14 @@ def create_population(species_id: int): return render_template( "populations/create-population.html", species=species, + families = population_families(conn), + genetic_types = population_genetic_types(conn), + mapping_methods=( + {"id": "0", "value": "No mapping support"}, + {"id": "1", "value": "GEMMA, QTLReaper, R/qtl"}, + {"id": "2", "value": "GEMMA"}, + {"id": "3", "value": "R/qtl"}, + {"id": "4", "value": "GEMMA, PLINK"}), activelink="create-population", **error_values) @@ -142,8 +152,11 @@ def create_population(species_id: int): "Name": population_name, "InbredSetName": population_fullname, "FullName": population_fullname, - "Family": request.form.get("inbredset_family") or None, - "Description": request.form.get("population_description") or None + "InbredSetCode": request.form.get("population_code") or None, + "Description": request.form.get("population_description") or None, + "Family": request.form.get("population_family") or None, + "MappingMethodId": request.form.get("population_mapping_method_id"), + "GeneticType": request.form.get("population_genetic_type") or None }) return redirect(url_for("species.populations.view_population", -- cgit v1.2.3