Skip to content
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

Fix router compatibility with DRF 3.8 #214

Merged
merged 4 commits into from
Apr 13, 2018
Merged

Fix router compatibility with DRF 3.8 #214

merged 4 commits into from
Apr 13, 2018

Conversation

rpkilby
Copy link
Contributor

@rpkilby rpkilby commented Apr 12, 2018

Hi all. I authored encode/django-rest-framework#5705, which seems to have broken compatibility with the routers in drf-extensions. Fixing this seem seem to largely be just removing old code. Resolves #211

Changes:

  • Remove ExtendedActionLinkRouterMixin. This feature seems to have been originally developed around the get_dynamic_route_viewset_method_name_by_endpoint method, but it's no longer called. Removing the class seems to have no effects on the tests (except for a few minor changes, see commit notes).
  • Drop API Root compat, which dates to DRF 3.4 (this change is not strictly necessary)
  • Fixed compatibility in the router tests.
    • Removed "trailing slash" compat, which dates to DRF 2.4
    • Use get_regex_pattern to handle regex pattern compatibility. This was added in DRF 3.7.4

I've ran the tests locally, and the unit and functional router tests are passing. I haven't made an attempt to fix the remaining tests, as it's outside the scope of the PR.

Ryan P Kilby added 4 commits April 12, 2018 14:34
This mixin is no longer necessary, as its features are present in DRF.
There are a few minor differences thought:
- Dynamic list routes no longer have a `-list` suffixed route name.
- Dynamic routes are no longer first in the route order, instead the
  order is list, dynamic list, detail, dynamic detail.
Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great. thanks

@auvipy auvipy merged commit edaa2dd into chibisov:master Apr 13, 2018
rpkilby referenced this pull request in encode/django-rest-framework Apr 13, 2018
* Merge list/detail route decorators into 'action'

* Merge dynamic routes, add 'detail' attribute

* Add 'ViewSet.get_extra_actions()'

* Refactor dynamic route checking & collection

* Refactor dynamic route generation

* Add 'ViewSet.detail' initkwarg

* Fixup schema test

* Add release notes for dynamic action changes

* Replace list/detail route decorators in tests

* Convert tabs to spaces in router docs

* Update docs

* Make 'detail' a required argument of 'action'

* Improve router docs
@rpkilby rpkilby deleted the router-fixes branch April 13, 2018 20:50
@gaozhidf
Copy link

@auvipy, I also met the problem, and do you have any plans to publish new release or any other way I can use it

@auvipy
Copy link
Collaborator

auvipy commented May 18, 2018

install from git master using pip for now

@auvipy auvipy added this to the 0.4.0 milestone Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatibility with drf 3.8.1
3 participants