I\'m using Django 2.0
and Django REST Framework
I have created an action method to delete particular object from database
conta
Solved the problem using drf-nested-routers
For those who need it, install the plugin and configure urls.py
from rest_framework_nested import routers
router = routers.SimpleRouter()
router.register(r'contacts', ContactViewSet, 'contacts')
contact_router = routers.NestedSimpleRouter(router, r'contacts', lookup='contact')
contact_router.register(r'phone_number', ContactPhoneNumberViewSet, base_name='contact-phone-numbers')
api_urlpatterns = [
path('', include(router.urls)),
path('', include(contact_router.urls))
]