def tag request slug tag get_object_or_404 Tag slug slug kwargs kwargs

1
2
3
4
5
6
7
def tag(request, slug):
tag = get_object_or_404(Tag, slug = slug)
kwargs = {}
kwargs['queryset'] = Item.objects.filter(tags=tag).order_by("-createDate")
kwargs['paginate_by'] = 5
kwargs['extra_context'] = {'title_text': tag.name}
return object_list(request, **kwargs)