File: urls.py

package info (click to toggle)
python-django-tagging 1%3A0.5.0-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 572 kB
  • sloc: python: 2,140; makefile: 166
file content (20 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (2)
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)),
]