Пример #1
0
def add_applicant():
    if request.method == "POST":
        new_applicant = {}
        for key in request.form.keys():
            new_applicant[key] = request.form[key]
        print(new_applicant)
        data_manager.add_applicant(new_applicant)
        url = 'applicants/' + new_applicant["application-code"]
        return redirect(url)
    return render_template('add-applicant.html')
Пример #2
0
def add_applicant():
    if request.method == 'POST':
        first_name = request.form['first-name']
        last_name = request.form['last-name']
        phone_number = request.form['phone-number']
        email = request.form['email']
        data_manager.add_applicant(first_name, last_name, phone_number, email)
        code = data_manager.get_max_id()
        code_data = code[0].get('max', '')
        app_code = data_manager.get_application_code_by_id(code_data)
        applicant_code = app_code[0].get('application_code', '')
        return redirect('/applicants/' + str(applicant_code))
    return render_template('add-applicant.html')
Пример #3
0
def add_new_applicant():
    if request.method == 'POST':
        first_name = request.form['first-name']
        last_name = request.form['last-name']
        phone_number = request.form['phone-number']
        email = request.form['email']
        id = randint(10000, 99999)
        application_id = str(id)
        data_manager.add_applicant(first_name, last_name, phone_number, email,
                                   id)
        return redirect('/applicants/' + application_id)
    else:
        return render_template('add_applicant.html')
Пример #4
0
def add_applicant():
    if request.method == "POST":
        applicant = request.form
        data_manager.add_applicant(applicant)
        return redirect('/applicants')
    return render_template('add_applicant.html')