Exemple #1
0
def visit_vehicle_level2(make, model, level1):
    level2_tuples = analyse_level1(select_level2(make, model, level1))

    results_dictionary, sum_of_counts = utilities.create_results_dictionary(level2_tuples)

    #fig = utilities.results_graph(results_dictionary)
    return render_template('resultlevel2.html', results=results_dictionary,
        make=make, model=model, total=sum_of_counts, level1=level1)
Exemple #2
0
def visit_vehicle_level2_byyear(make, model, level1, year):
    level2_tuples = select_level2(make, model, level1, year)

    results_dictionary, sum_of_counts = utilities.create_results_dictionary(level2_tuples)

    fig = utilities.results_graph(results_dictionary)

    return render_template('resultlevel2_year.html', results=results_dictionary,
        make=make, model=model, year=year, total=sum_of_counts, level1=level1, fig=fig)
Exemple #3
0
def visit_vehicle_level1(make, model):
    """obtain the values chosen by the user for make and model..."""
    level1 = extract_level1(select_make_model(make, model))
    #print(level1)
    level1_tuples = analyse_level1(level1)
    results_dictionary, sum_of_counts = utilities.create_results_dictionary(level1_tuples)
    fig = utilities.results_graph(results_dictionary)
    return render_template('resultlevel1.html', results=results_dictionary,
        make=make, model=model, total=sum_of_counts, fig=fig)
Exemple #4
0
def visit_vehicle_level2(make, model, level1):
    level2_tuples = analyse_level1(select_level2(make, model, level1))

    results_dictionary, sum_of_counts = utilities.create_results_dictionary(
        level2_tuples)

    #fig = utilities.results_graph(results_dictionary)
    return render_template('resultlevel2.html',
                           results=results_dictionary,
                           make=make,
                           model=model,
                           total=sum_of_counts,
                           level1=level1)
Exemple #5
0
def visit_vehicle_level1(make, model):
    """obtain the values chosen by the user for make and model..."""
    if make in data_dict and model in data_dict[make]:
        level1 = extract_level1(select_make_model(make, model))
        #print(level1)
        level1_tuples = analyse_level1(level1)
        results_dictionary, sum_of_counts = utilities.create_results_dictionary(level1_tuples)
        #fig = utilities.results_graph(results_dictionary)
        return render_template('resultlevel1.html', results=results_dictionary,
            make=make, model=model, total=sum_of_counts)
    else:
        error = 'There are no failures for ' + make + ' ' + model + ' in the data set'
        return render_template("error.html", error=error)
Exemple #6
0
def visit_vehicle_level1(make, model):
    """obtain the values chosen by the user for make and model..."""
    level1 = extract_level1(select_make_model(make, model))
    #print(level1)
    level1_tuples = analyse_level1(level1)
    results_dictionary, sum_of_counts = utilities.create_results_dictionary(
        level1_tuples)
    fig = utilities.results_graph(results_dictionary)
    return render_template('resultlevel1.html',
                           results=results_dictionary,
                           make=make,
                           model=model,
                           total=sum_of_counts,
                           fig=fig)
Exemple #7
0
def visit_vehicle_level2_byyear(make, model, level1, year):
    level2_tuples = select_level2(make, model, level1, year)

    results_dictionary, sum_of_counts = utilities.create_results_dictionary(
        level2_tuples)

    fig = utilities.results_graph(results_dictionary)

    return render_template('resultlevel2_year.html',
                           results=results_dictionary,
                           make=make,
                           model=model,
                           year=year,
                           total=sum_of_counts,
                           level1=level1,
                           fig=fig)
Exemple #8
0
def visit_vehicle_level1(make, model):
    """obtain the values chosen by the user for make and model..."""
    if make in data_dict and model in data_dict[make]:
        level1 = extract_level1(select_make_model(make, model))
        #print(level1)
        level1_tuples = analyse_level1(level1)
        results_dictionary, sum_of_counts = utilities.create_results_dictionary(
            level1_tuples)
        #fig = utilities.results_graph(results_dictionary)
        return render_template('resultlevel1.html',
                               results=results_dictionary,
                               make=make,
                               model=model,
                               total=sum_of_counts)
    else:
        error = 'There are no failures for ' + make + ' ' + model + ' in the data set'
        return render_template("error.html", error=error)