def edit_tag(id): """Edit existing tag information in database""" tag = request.form["tag_name"] if (tag == ""): flash("Missing Input: Please fill out a tag name to edit tag") return redirect(f"/edit_tag/{id}") Tag.update_tag(Tag.get_single_tag(id), tag) return redirect(f"/tag_detail/{id}")
def edit_tag_form(id): tag = Tag.get_single_tag(id) return render_template("./edit_tag.html", tag=tag)
def tag_detail(id): """Show tag detail template""" tag = Tag.get_single_tag(id) posts = tag.posts return render_template("./tag_detail.html", tag=tag, posts=posts)