def post(self): form = MonkeyForm(request.form) if not form.validate(): return render_template('monkey_create.html', form=form) else: monkey = MonkeyViewHelper().create_monkey(form) return redirect(url_for('MonkeysView:get', id=monkey.id))
def post(self): form = MonkeyForm(request.form) if not form.validate(): return render_template("monkey_create.html", form=form) else: monkey = MonkeyViewHelper().create_monkey(form) return redirect(url_for("MonkeysView:get", id=monkey.id))
def create(self): form = MonkeyForm(request.form) return render_template('monkey_create.html', form=form)
def update(self, id): monkey = Monkey.query.get(id) form = MonkeyForm(request.form, monkey) if form.validate(): MonkeyViewHelper().update_monkey(monkey, form) return render_template('monkey_view.html', form=form, monkey=monkey)
def get(self, id): monkey = Monkey.query.get(id) form = MonkeyForm(request.form, monkey) return render_template('monkey_view.html', monkey=monkey, form=form)
def update(self, id): monkey = Monkey.query.get(id) form = MonkeyForm(request.form, monkey) if form.validate(): MonkeyViewHelper().update_monkey(monkey, form) return render_template("monkey_view.html", form=form, monkey=monkey)