drf-nested-routers icon indicating copy to clipboard operation
drf-nested-routers copied to clipboard

parent_prefix and lookup

Open cancan101 opened this issue 11 years ago • 8 comments

Is there any documentation on what parent_prefix and lookup and mean/ what they should be set to on a NestedSimpleRouter?

cancan101 avatar Jun 19 '14 20:06 cancan101

Hi, the DRF documentation contains information about prefix and lookup: http://www.django-rest-framework.org/api-guide/routers#custom-routers

HTH, Jesaja

jeverling avatar Jun 26 '14 12:06 jeverling

What about parent_prefix? I do not see that term mentioned on the page.

cancan101 avatar Jun 26 '14 14:06 cancan101

parent_prefix exists only in drf-nested-routers, it's the prefix that was passed to the parent_router. On Jun 26, 2014 4:39 PM, "Alex Rothberg" [email protected] wrote:

What about parent_prefix? I do not see that term mentioned on the page.

— Reply to this email directly or view it on GitHub https://github.com/alanjds/drf-nested-routers/issues/21#issuecomment-47233912 .

jeverling avatar Jun 26 '14 15:06 jeverling

On my wishlist is this parent_prefix to be grabbed automatically from the parent router, but time has been short even for docs. Sorry for that.

alanjds avatar Jun 26 '14 15:06 alanjds

Once I nest my routers and get: http://host/api/parents/parentID/children/

Can I still do ordering, search, filter on children? http://host/api/parents/parentID/children?search=someSearch

Is there special configuration I have to setup?

saneletm avatar Sep 16 '15 21:09 saneletm

yes, with the apropriate configurations on the viewset/serializer

jsenecal avatar Sep 16 '15 21:09 jsenecal

do you have a sample appropriate config that I can see? How does this differ from doing un nested for the viewset/serializer

saneletm avatar Sep 16 '15 21:09 saneletm

No difference - the only config is what you would usually do for a search filter to work

jsenecal avatar Sep 16 '15 21:09 jsenecal