summaryrefslogtreecommitdiff
path: root/lib/taggit/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/taggit/views.py')
-rw-r--r--lib/taggit/views.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/taggit/views.py b/lib/taggit/views.py
deleted file mode 100644
index 68e955b..0000000
--- a/lib/taggit/views.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from django.contrib.contenttypes.models import ContentType
-from django.shortcuts import get_object_or_404
-from django.views.generic.list_detail import object_list
-
-from taggit.models import TaggedItem, Tag
-
-
-def tagged_object_list(request, slug, queryset, **kwargs):
- if callable(queryset):
- queryset = queryset()
- tag = get_object_or_404(Tag, slug=slug)
- qs = queryset.filter(pk__in=TaggedItem.objects.filter(
- tag=tag, content_type=ContentType.objects.get_for_model(queryset.model)
- ).values_list("object_id", flat=True))
- if "extra_context" not in kwargs:
- kwargs["extra_context"] = {}
- kwargs["extra_context"]["tag"] = tag
- return object_list(request, qs, **kwargs)