chibisov / drf-extensions

DRF-extensions is a collection of custom extensions for Django REST Framework
http://chibisov.github.io/drf-extensions/docs
MIT License
1.47k stars 208 forks source link

How to have multiple nested routes under a parent route #185

Closed kowsari closed 7 years ago

kowsari commented 7 years ago

Hi I have /api/case which has a /api/case/:caseid/patient route now. I would like add /api/case/:caseid/meeting underneath case, but when I try to do the following I get an error.

router.register(r'case', case.CaseViewSet).\ register(r'patient', misc.PatientViewSet, base_name='case-patient', parents_query_lookups=['patient_cases']).\ register(r'meeting', meeting.MeetingViewSet, base_name='case-meeting', parents_query_lookups=['case_meetings'])

Is there anyway to do this with DRF extensions nested routers?

Thanks

kowsari commented 7 years ago

I realized how to do this from the docs.