poulpe/api/urls.py
Aurélien Delobelle 82d361e775 API supports Activity
- Add ActivitySerializer + tests.
- Add 'places' field to ActivityTemplateSerializer.
2017-09-04 16:24:34 +02:00

27 lines
883 B
Python

from django.conf.urls import url, include
from rest_framework_nested.routers import SimpleRouter, NestedSimpleRouter
from api.event import views
router = SimpleRouter()
router.register(r'event', views.EventViewSet)
router.register(r'place', views.PlaceViewSet)
router.register(r'tag', views.ActivityTagViewSet)
# Views behind /event/<event_pk>/...
event_router = NestedSimpleRouter(router, r'event', lookup='event')
event_router.register(r'place', views.PlaceViewSet)
event_router.register(r'tag', views.ActivityTagViewSet)
event_router.register(r'template', views.ActivityTemplateViewSet)
event_router.register(r'activity', views.ActivityViewSet)
# API URLconf: routers + auth for browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^', include(event_router.urls)),
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
]