Example #1
0
def codelists_management():
    return render_template(
        "codelists.html",
        loggedinuser=current_user,
        codelist_codes=codelists.get_db_codelists(),
        codelist_names=codelists.get_db_codelist_names(),
        countries=codelists.get_codelists()["Country"],
        countries_locations=qlocation.get_countries_locations())
Example #2
0
def import_locations():
    existing_countries = list(map(lambda l: l.country.code, qlocation.get_countries_locations()))
    country_code = request.form.get("country")
    if not country_code in existing_countries:
        qlocation.import_locations(country_code)
        flash("Locations successfully set up for that county!", "success")
    else:
        flash("Locations for that country were not imported, because they have already been imported!", "danger")
    return redirect(url_for("codelists_management"))
Example #3
0
def codelists_management():
    return render_template(
        "codelists.html",
        loggedinuser=current_user,
        codelist_codes=codelists.get_db_codelists(),
        codelist_names=codelists.get_db_codelist_names(),
        countries=codelists.get_codelists()["Country"],
        countries_locations=qlocation.get_countries_locations(),
    )
Example #4
0
def import_locations():
    existing_countries = list(
        map(lambda l: l.country.code, qlocation.get_countries_locations()))
    country_code = request.form.get("country")
    if not country_code in existing_countries:
        qlocation.import_locations(country_code)
        flash("Locations successfully set up for that county!", "success")
    else:
        flash(
            "Locations for that country were not imported, because they have already been imported!",
            "danger")
    return redirect(url_for("codelists_management"))