コード例 #1
0
def delete_category():

    if request.method == 'POST':

        category_name = request.form['category_name']

        #print(dut_fpga)

        #last_update= datetime.datetime.now()

        id_category = work_with_db_category.return_id_by_category(
            category_name)
        work_with_db_record.delete_all_records_by_id_category(id_category)

        ans = work_with_db_record.select_all_category_recorde_by_category_id(
            id_category)
        #print("ans ",ans)
        work_with_db_category.delete_task(id_category)

        return redirect('/management246')

        print(category_name, category_description, pic_link)

    else:

        ans = work_with_db_category.select_all_categories()
        return render_template('delete_category.html', **locals())
コード例 #2
0
def management246():

    print("from manage")

    ans = work_with_db_category.select_all_categories()

    return render_template('management246.html', **locals())
コード例 #3
0
def choose_category_for_deleting_record():

    if request.method == 'POST':

        print("esdfsdfsd")
        category_name = request.form['category_name']
        #ans=work_with_db_category.select_all_categories()
        id = work_with_db_category.return_id_by_category(category_name)

        ans = work_with_db_category.return_category_data_by_id(id)
        #print("id---",id)
        print("anssssss:", ans)
        ans = work_with_db_record.select_all_category_recorde_by_category_id(
            ans[0])

        session['message'] = ans

        return redirect('/delete_record_from_category')

        print(category_name, category_description, pic_link)

    else:

        ans = work_with_db_category.select_all_categories()
        return render_template('choose_category_for_deleting_record.html',
                               **locals())
コード例 #4
0
def choose_category_for_adding_record():

    #print("from edit category")

    if request.method == 'POST':

        #print("esdfsdfsd")
        category_name = request.form['category_name']
        #ans=work_with_db_category.select_all_categories()
        id = work_with_db_category.return_id_by_category(category_name)

        ans = work_with_db_category.return_category_data_by_id(id)
        #print("id---",id)
        session['message'] = ans

        return redirect('/insert_record_to_category')

        print(category_name, category_description, pic_link)

    else:

        #print("from choose get")

        ans = work_with_db_category.select_all_categories()
        return render_template('choose_category_for_adding_record.html',
                               **locals())
コード例 #5
0
def root():

    if request.method == 'POST':
        category_name = request.form['category_name']
        ans = work_with_db_category.select_all_categories()
        category_id = work_with_db_category.return_id_by_category(
            category_name)
        ans_category = work_with_db_record.select_all_category_recorde_by_category_id(
            category_id)

        return render_template('show_category_data.html', **locals())

        print("cstegory", category_name)
        pass

    ans = work_with_db_category.select_all_categories()

    #date=datetime.datetime()
    # i = datetime.datetime.now()
    # checktime = str(i)
    # checktime = checktime[0:19]
    return render_template('main.html', **locals())
コード例 #6
0
def choose_edit_category():

    #print("from edit category")

    if request.method == 'POST':

        print("esdfsdfsd")
        category_name = request.form['category_name']
        #ans=work_with_db_category.select_all_categories()
        id = work_with_db_category.return_id_by_category(category_name)

        ans = work_with_db_category.return_category_data_by_id(id)
        #print("id---",id)
        session['message'] = ans

        return redirect('/edit_category')

    else:

        #print("from choose get")

        ans = work_with_db_category.select_all_categories()
        return render_template('choose_edit_category.html', **locals())