src/notes/api/urls.py
author ymh <ymh.work@gmail.com>
Wed, 21 Jun 2017 08:45:29 +0200
changeset 70 dff58e6bea47
parent 31 63be3ce389f7
child 119 8ff8e2aee0f9
permissions -rw-r--r--
Ass src/sass in the watch list for node-sass

from django.conf.urls import url, include
from rest_framework_nested import routers
from .views import SessionViewSet, NoteViewSet

router = routers.SimpleRouter()
router.register(r'sessions', SessionViewSet, base_name='session')

session_router = routers.NestedSimpleRouter(router, r'sessions', lookup='session')
session_router.register(r'notes', NoteViewSet, base_name='notes')

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^', include(session_router.urls)),
]