Beispiel #1
0
def details(id):
    """GET and POST for displaying pet details and editing pet """

    pet = Pet.get(id)
    form = EditForm(obj=pet)
    if (form.validate_on_submit()):
        EditForm.fill_pet(form, pet)
        db.session.commit()
        return redirect('/')

    return render_template('details.html', pet=pet, form=form)