# Path: rest_framework_extensions/routers.py
# class ExtendedDefaultRouter(ExtendedRouterMixin, DefaultRouter):
#     pass
# 
# Path: tests_app/tests/functional/routers/extended_default_router/views.py
# class UserViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterUserModel.objects.all()
# 
# class GroupViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterGroupModel.objects.all()
# 
# class PermissionViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterPermissionModel.objects.all()


from rest_framework_extensions.routers import ExtendedDefaultRouter
from .views import (
    UserViewSet,
    GroupViewSet,
    PermissionViewSet,
)



router = ExtendedDefaultRouter()
# nested routes
(
    router.register(r'users', UserViewSet)
          .register(r'groups', GroupViewSet, 'users-group', parents_query_lookups=['user_groups'])
          .register(r'permissions', PermissionViewSet, 'users-groups-permission', parents_query_lookups=['group__user', 'group'])
)
# simple routes

# Path: rest_framework_extensions/routers.py
# class ExtendedDefaultRouter(ExtendedRouterMixin, DefaultRouter):
#     pass
# 
# Path: tests_app/tests/functional/routers/extended_default_router/views.py
# class UserViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterUserModel.objects.all()
# 
# class GroupViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterGroupModel.objects.all()
# 
# class PermissionViewSet(NestedViewSetMixin, ModelViewSet):
#     queryset = DefaultRouterPermissionModel.objects.all()


# Path: tests_app/tests/functional/routers/extended_default_router/urls.py
from rest_framework_extensions.routers import ExtendedDefaultRouter
from .views import (
    UserViewSet,
    GroupViewSet,
    PermissionViewSet,
)




router = ExtendedDefaultRouter()
# nested routes
(
    router.register(r'users', UserViewSet)
          .register(r'groups', GroupViewSet, 'users-group', parents_query_lookups=['user_groups'])
          .register(r'permissions', PermissionViewSet, 'users-groups-permission', parents_query_lookups=['group__user', 'group'])
)
# simple routes

router.register(r'groups', GroupViewSet, 'group')