-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathurls.py
More file actions
67 lines (62 loc) · 2 KB
/
urls.py
File metadata and controls
67 lines (62 loc) · 2 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
URL patterns for the first version of the Lunes API
"""
from django.urls import include, path
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
from ..utils import OptionalSlashRouter, find_duplicates_for_word
from . import views
#: The namespace for this URL config (see :attr:`django.urls.ResolverMatch.app_name`)
app_name = "v1"
#: Router for dynamic url patterns
router = OptionalSlashRouter()
router.register(r"disciplines", views.DisciplineViewSet, "disciplines")
router.register(
"disciplines_by_level/",
views.DisciplineFilteredViewSet,
"disciplines_overview",
)
router.register(
r"disciplines_by_level/(?P<discipline_id>[0-9]+)?",
views.DisciplineFilteredViewSet,
"disciplines_by_level",
)
router.register(
r"disciplines_by_group/(?P<group_id>[0-9]+)",
views.DisciplineFilteredViewSet,
"discipline_by_group",
)
router.register(
r"training_set/(?P<discipline_id>[0-9]+)", views.TrainingSetViewSet, "training_set"
)
router.register(
r"training_sets",
views.TrainingSetByIdViewSet,
"training_sets",
)
router.register(
r"documents/(?P<training_set_id>[0-9]+)", views.DocumentViewSet, "documents"
)
router.register(
r"document_by_id/(?P<document_id>[0-9]+)", views.DocumentByIdViewSet, "documents"
)
router.register(r"words", views.WordViewSet, "words")
router.register(r"group_info", views.GroupViewSet, "group_by_id")
router.register(r"feedback", views.CreateFeedbackViewSet, "feedback")
router.register(r"sponsors", views.SponsorsViewSet, "sponsors")
#: The url patterns of this module (see :doc:`django:topics/http/urls`)
urlpatterns = [
path("", include(router.urls)),
path("schema/", SpectacularAPIView.as_view(), name="schema"),
path(
"docs/",
SpectacularSwaggerView.as_view(
template_name="swagger_ui.html", url_name="api:v1:schema"
),
name="swagger-ui",
),
path(
"search_duplicate/<word>",
find_duplicates_for_word,
name="search_duplicate",
),
]