예제 #1
0
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}")
예제 #2
0
def edit_tag_form(id):
    tag = Tag.get_single_tag(id)
    return render_template("./edit_tag.html", tag=tag)
예제 #3
0
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)