summaryrefslogtreecommitdiff
path: root/app/links/urls.py
blob: f789b4dac4181835cec2822b085d99298f64cc00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from django.urls import path, re_path
from django.views.generic.base import RedirectView

from . import views

app_name = "links"

urlpatterns = [
    re_path(
        r'^tag/(?P<slug>[-\w]+)/$',
        views.LinkTagListView.as_view(),
        {'page':1}, 
        name='list-tag'
    ),
    re_path(
        r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$',
        views.LinkTagListView.as_view(),
        name='list-tag'
    ),
    path(
        r'<int:slug>',
        views.LinkDetailView.as_view(),
        name='detail'
    ),
    re_path(
        r'(?P<page>\d+)/$',
        views.LinkListView.as_view(),
        name='list'
    ),
    path(
        r'',
        views.LinkListView.as_view(),
        {'page':1}, 
        name='list'
    ),
]