New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExtendedDefaultRouter root view is polluted #57
Comments
This is because your The |
I saw that the URL was duplicated. This does not fully explain the issue, however.
|
Either way, the nested item should not be exposed at the top level (ie root view). The only reason this works when changing the base name is: for key, url_name in api_root_dict.items():
try:
ret[key] = reverse(url_name, request=request, format=format)
except NoReverseMatch:
pass where Changing the There is no reason that Right now I am trying to move to drf-extensions from https://github.com/alanjds/drf-nested-routers and I had been able to use the same |
The issue here is that register called on |
Yes, multiple routes can share the same name and take in different arguments.
This is intentional and it was added in #14. I don't know of a better way to handle it, but I'm sure a pull request would be reviewed if it came in.
If I remember correctly, |
@kevin-brown I think the root cause for all of this is: #57 (comment) That is implicitly how drf-extensions deals with the issue: it does NOT add all of the routes to the base router but required you to add those routers individually. |
@kevin-brown Any more thoughts on this? |
@kevin-brown Thoughts? |
@cancan101 looks like it's up to @chibisov. For what it's worth, you'd have this issue without the custom router now that DRF also has the |
The issue here is that This is different from how drf-nested-routers works where each nested router keeps track of the URLs (routes) at its level. |
closing |
I am using
ExtendedDefaultRouter
with nested routes. Right now my root view is being polluted by the sub items:The text was updated successfully, but these errors were encountered: