def filter(request, tag): """ Given a slug, uses filter.html to display all the things tagged with that specific tag """ tag = get_object_or_404(Tag, owner=request.user, slug=makeslug(tag)) ctx = {} if not tag.pinned: # Don't display "tags" thing as active when the tag is pinned ctx["area"] = "tags" ctx["tag"] = tag ctx["pin_form"] = PinTagForm(instance=tag) ctx["bookmarks"] = make_page(Bookmark.get_by_tag(tag), request.GET.get("p")) return TemplateResponse(request, "tags/filter.html", ctx)