diff options
Diffstat (limited to 'uploader/genotypes')
| -rw-r--r-- | uploader/genotypes/views.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py index 2a0e0f8..8c0795d 100644 --- a/uploader/genotypes/views.py +++ b/uploader/genotypes/views.py @@ -3,6 +3,7 @@ import logging from MySQLdb.cursors import DictCursor from pymonad.either import Left, Right, Either +from gn_libs.requests import request_json from gn_libs.mysqldb import database_connection from werkzeug.exceptions import UnsupportedMediaType from flask import (flash, @@ -37,15 +38,16 @@ render_template = make_template_renderer("genotypes") @genotypesbp.route( "/<int:species_id>/populations/<int:population_id>/genotypes", - methods=["GET"]) + methods=["GET", "POST"]) @require_login @with_population(species_redirect_uri="species.list_species", redirect_uri="species.populations.list_species_populations") def index(species: dict, population: dict, **kwargs):# pylint: disable=[unused-argument] """Entry-point to the genotypes management section.""" with database_connection(app.config["SQL_URI"]) as conn: - offset = int(request.args.get("start", "0")) - number_of_records = int(request.args.get("count", "10")) + form = request_json() + offset = int(form.get("start", "0")) + number_of_records = int(form.get("length", "10")) _markers, _total_markers, = genotype_markers( conn, species["SpeciesId"], population["Id"]) _genotype_records, _count = genotype_records( @@ -68,7 +70,8 @@ def index(species: dict, population: dict, **kwargs):# pylint: disable=[unused-a "genotype_records": _genotype_records, "total_genotype_records": _count, "fetched_genotype_records": len(_genotype_records), - "sample_order": _samples + "samples_order": _samples, + "draw": int(request.args.get("draw", "0")) }), 200) if "text/html" in request.headers["Accept"]: |
