| author | ymh <ymh.work@gmail.com> |
| Tue, 29 Mar 2022 11:23:56 +0200 | |
| changeset 211 | 244a90638e80 |
| parent 126 | ba8bc0199464 |
| permissions | -rw-r--r-- |
| 31 | 1 |
from django.conf.urls import url, include |
2 |
from rest_framework_nested import routers |
|
| 126 | 3 |
from .views import SessionViewSet, NoteViewSet, RootNoteViewSet, ListLogsView |
| 31 | 4 |
|
5 |
router = routers.SimpleRouter() |
|
6 |
router.register(r'sessions', SessionViewSet, base_name='session') |
|
|
119
8ff8e2aee0f9
add parameter to filter session and note by updated date. Add pagination on sessions and notes. add read only endpoint at root level to list notes
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
7 |
router.register(r'notes', RootNoteViewSet, base_name='note') |
| 31 | 8 |
|
9 |
session_router = routers.NestedSimpleRouter(router, r'sessions', lookup='session') |
|
|
119
8ff8e2aee0f9
add parameter to filter session and note by updated date. Add pagination on sessions and notes. add read only endpoint at root level to list notes
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
10 |
session_router.register(r'notes', NoteViewSet, base_name='notes-session') |
| 31 | 11 |
|
12 |
# Wire up our API using automatic URL routing. |
|
13 |
# Additionally, we include login URLs for the browsable API. |
|
14 |
urlpatterns = [ |
|
15 |
url(r'^', include(router.urls)), |
|
16 |
url(r'^', include(session_router.urls)), |
|
| 126 | 17 |
url(r'sync/', ListLogsView.as_view(), name='sync-list') |
| 31 | 18 |
] |