Exemplo n.º 1
0
def wizard_start():
    # clearing session counter
    clearsession()
    startlist_display = [(st.id, st.name)
                         for st in StartlistNameModel.list_all()
                         if not st.measured_flag]
    return render_template('startlist/create_new_wizard.html',
                           data=startlist_display)
Exemplo n.º 2
0
def startlist_one_delete():
    startlist_id = request.form['startlist_select']

    startlist_name = StartlistNameModel.get_name_by_id(startlist_id)

    deleted = startlist_processing.delete_startlist_by_id(startlist_id)

    startlist_all = [(stlist.id, stlist.name)
                     for stlist in StartlistNameModel.list_all()]

    if deleted:
        return render_template(
            'startlist/startlist_one_menu_delete_success.html',
            data=startlist_all,
            startlist_name=startlist_name)
    return render_template('startlist/startlist_one_menu_delete_fail.html',
                           data=startlist_all,
                           startlist_name=startlist_name)
Exemplo n.º 3
0
def startlist_one_rename_save():
    startlist_id = session['startlist_id']
    new_startlist_name = request.form['new_startlist_name']

    renamed = startlist_processing.rename_startlist_by_id(
        startlist_id, new_startlist_name)

    startlist_all = [(stlist.id, stlist.name)
                     for stlist in StartlistNameModel.list_all()]

    if renamed:
        return render_template(
            'startlist/startlist_one_menu_rename_success.html',
            data=startlist_all,
            startlist_name=new_startlist_name)
    return render_template('startlist/startlist_one_menu_rename_fail.html',
                           data=startlist_all,
                           startlist_name=new_startlist_name)
Exemplo n.º 4
0
def get_startlist_instances():
    return [startlist_def for startlist_def in StartlistNameModel.list_all()]
Exemplo n.º 5
0
def startlist_menu_delete():
    startlist_all = [(stlist.id, stlist.name)
                     for stlist in StartlistNameModel.list_all()]
    return render_template('startlist/startlist_one_menu_delete.html',
                           data=startlist_all)