Add ability to filter by no tags on package tags page

This commit is contained in:
rubenwardy
2021-02-05 16:57:40 +00:00
parent 3839dfbf90
commit 7ff92bc7c1
2 changed files with 17 additions and 3 deletions

View File

@@ -117,9 +117,14 @@ def tags():
qb.setSortIfNone("score", "desc")
query = qb.buildPackageQuery()
only_no_tags = isYes(request.args.get("no_tags"))
if only_no_tags:
query = query.filter(Package.tags==None)
tags = Tag.query.order_by(db.asc(Tag.title)).all()
return render_template("todo/tags.html", current_tab="tags", packages=query.all(), tags=tags)
return render_template("todo/tags.html", current_tab="tags", packages=query.all(), \
tags=tags, only_no_tags=only_no_tags)
@bp.route("/user/tags/")