-
Notifications
You must be signed in to change notification settings - Fork 264
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
Augment get_route_for_model()
to support REST API routes.
#2223
Conversation
7215fb0
to
01419af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's also a case in nautobot.utilities.views.GetReturnURLMixin.get_return_url
that could perhaps also use get_route_for_model
?
get_route_for_model()
to support REST API routes.get_route_for_model()
to support REST API routes.
get_route_for_model()
to support REST API routes.get_route_for_model()
to support REST API routes.
@jathanism What's needed to move this out of draft status? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_route_for_model()
to support REST API routes.get_route_for_model()
to support REST API routes.
Get the tests passing? 😩 |
6fc4f8e
to
435bc8e
Compare
- This adds an `api=True` argument to `nautobot.utilities.utils.get_route_for_model` - Replaced almost all bespoke implementations of manual route construction for plugins or API routes with calls to `get_route_for_model()` - Expanded the Development Best Practices guide with a section on "Getting URL Routes" - Eliminated `view_namespace` attribute from `nautobot.utilities.testing.api.APITestCase` as its only legit use-case was for the Django built-in `Group` model. So this route is now just hard-coded on `nautobot.users.tests.test_api.GroupTest` now by overloading `_get_detail_url()` and `_get_list_url()`
435bc8e
to
5c0ad97
Compare
… use `get_route_for_model`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes: #2243
What's Changed
api=True
argument tonautobot.utilities.utils.get_route_for_model()
get_route_for_model()
TODO