1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
"""Test urls for tagging."""
from django.urls import re_path
from tagging.tests.models import Article
from tagging.views import TaggedObjectList
class StaticTaggedObjectList(TaggedObjectList):
tag = 'static'
queryset = Article.objects.all()
urlpatterns = [
re_path(r'^static/$', StaticTaggedObjectList.as_view()),
re_path(r'^static/related/$', StaticTaggedObjectList.as_view(
related_tags=True)),
re_path(r'^no-tag/$', TaggedObjectList.as_view(model=Article)),
re_path(r'^no-query-no-model/$', TaggedObjectList.as_view()),
re_path(r'^(?P<tag>[^/]+(?u))/$', TaggedObjectList.as_view(model=Article)),
]
|