drf-nested-routers

drf-nested-routers RuntimeError('parent registered resource not found')

落花浮王杯 提交于 2020-01-02 18:58:34
问题 I am attempting to utilize the package drf-nested-routers to created nested routes within my API. I've attempted to follow alongside the documentation (https://github.com/alanjds/drf-nested-routers) as well as read through multiple Stackoverflow threads in hopes to figure out this issue. I would like to create a single NestedSimpleRouter. Here is what I have so far inside of my routers.py file: from django.urls import path, include from rest_framework.routers import DefaultRouter from rest

Custom Hyperlinked URL field for more than one lookup field in a serializer of DRF

China☆狼群 提交于 2019-12-08 09:12:25
问题 I am using Django Rest Framework for developing web api for my project. As in my project i need to build nested api's endpoint like this: /users/ - to get all users /users/<user_pk> - to get details of a particular user /users/<user_pk>/mails/ - to get all mails sent by a user /users/<user_pk>/mails/<pk> - to get details of a mail sent by a user So, i am using drf-nested-routers for ease of writing & maintaing these nested resources. I want output of all my endpoints have hyperlink for

drf-nested-routers RuntimeError('parent registered resource not found')

孤人 提交于 2019-12-06 20:45:28
I am attempting to utilize the package drf-nested-routers to created nested routes within my API. I've attempted to follow alongside the documentation ( https://github.com/alanjds/drf-nested-routers ) as well as read through multiple Stackoverflow threads in hopes to figure out this issue. I would like to create a single NestedSimpleRouter. Here is what I have so far inside of my routers.py file: from django.urls import path, include from rest_framework.routers import DefaultRouter from rest_framework_nested import routers from api_v1.viewsets import DeviceViewSet, BreadcrumbViewSet router =