-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathurls.py
48 lines (46 loc) · 1.03 KB
/
urls.py
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
37
38
39
40
41
42
43
44
45
46
47
48
from django.urls import path
from django.views.decorators.cache import cache_page
from .models import Report
from .views import (
LikedByUserReportList,
ReportDetail,
ReportList,
UnsubscribeView,
report_stats,
)
from fixmyapp.views import LikeView
app_name = 'reports'
# fmt: off
urlpatterns = [
path(
'reports',
cache_page(60 * 60 * 4)(ReportList.as_view()),
name='report-list'
),
path(
'reports/<int:pk>',
ReportDetail.as_view(),
name='report-detail'
),
path(
'users/me/liked/reports',
LikedByUserReportList.as_view(),
name='reports-liked-by-user'
),
path(
'reports/<int:pk>/likes',
LikeView.as_view(),
{'model': Report},
name='likes-reports',
),
path(
'reports/unsubscribe/<int:user_id>/<str:access_key>',
UnsubscribeView.as_view(),
name='unsubscribe-report-update'
),
path(
'reports/stats',
cache_page(15)(report_stats)
)
]
# fmt: on