from django.conf.urls import include, url

from rest_framework_nested import routers

from journal import views

router = routers.DefaultRouter()
router.register(r'journals', views.JournalViewSet)
router.register(r'journal/(?P<journal_uid>[^/]+)', views.EntryViewSet)
router.register(r'user', views.UserInfoViewSet)

domains_router = routers.NestedSimpleRouter(router, r'journals', lookup='journal')
domains_router.register(r'members', views.MembersViewSet, base_name='journal-members')


urlpatterns = [
    url(r'^api/v1/', include(router.urls)),
    url(r'^api/v1/', include(domains_router.urls)),
]

# Adding this just for testing, this shouldn't be here normally
urlpatterns += url(r'^reset/$', views.reset, name='reset_debug'),

@@ -310,22 +310,23 @@
 ewSet)%0A%0A
-domain
+journal
 s_router
@@ -394,22 +394,23 @@
 urnal')%0A
-domain
+journal
 s_router
@@ -577,14 +577,15 @@
 ude(
-domain
+journal
 s_ro

rename wrongly named router.