Ejemplo n.º 1
0
def ask_update_contact():
    try:
        contacts.update_contact(e_name.get(), e_phone.get())
        clear_entries()
        tkMessageBox.showinfo("Success", "Contact updated")
    except ValueError as e:
        tkMessageBox.showerror("Error", e)
Ejemplo n.º 2
0
def ask_update_contact():
    try:
        contacts.update_contact(e_name.get(), e_phone.get())
        clear_entries()
        tkMessageBox.showinfo("Success", "Contact updated")
    except ValueError as e:
        tkMessageBox.showerror("Error", e)
Ejemplo n.º 3
0
def update():
    if request.method == 'POST':
        try:
            contacts.update_contact(request.form['name'],
                                    request.form['phone'])
            session['message'] = "Contact updated: {}".format(
                request.form['name'])
            return redirect('/')
        except ValueError as e:
            return render_template('update.html',
                                   message=e,
                                   name=request.form['name'],
                                   phone=request.form['phone'])
    return render_template('update.html')
Ejemplo n.º 4
0
def update():
    if request.method == 'POST':
        try:
            contacts.update_contact(request.form['name'], request.form['phone'])
            session['message'] = "Contact updated: {}".format(request.form['name'])
            return redirect('/')
        except ValueError as e:
            return render_template(
                'update.html',
                message=e,
                name=request.form['name'],
                phone=request.form['phone']
            )
    return render_template('update.html')