-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Customize URL #96
Comments
I think so but Instead of defining the urls for the whole app like this:
You should define the urls for every CRUD resource like this:
And you will get urls like:
Please take a look to the documentation and the testapp sample in the repo:
Dunno if it fits for you, feedback is always welcome ;) |
Maybe a good idea is be able to pass the url you want to
|
this solution does not work, gives the following error and the server does not sell path('api/ina/', include(MotivoInasistenciaCRUDView().get_urls('list'))),
TypeError: get_urls() takes 1 positional argument but 2 were given in this other path('api/ina/', include(MotivoInasistenciaCRUDView().get_urls())), I form this url api/ina/ |
No, I don't mean it's working now like that, I mean that could be a good idea to extend the functionality -as a new feature- if you call |
Ok, sorry yes that great Thanks |
From a conceptual point of view, I think it makes sense, as you may not want to expose the full CRUD urls. Or as mentioned, customize only one or the other resource. |
I think that it could be nice to customize the URL and the URL name we can achieve this by making a dict attribute. If dict is None then the "normal" behavior, else if the dict have the key "list" : { "name" = "auth_group_list", "url" : "/auth/group/list" } It would be nice and easy I think :) |
It is possible to customize the URL, to give a complete form to the root, for example instead of
127.0.0.1:8000/app_two/model_1/list
to be
127.0.0.1:8000/api/list
Thank you so much
The text was updated successfully, but these errors were encountered: