Skip to content

replace DRF @list_route and @detail_route with @action #659

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

Closed
wants to merge 1 commit into from

Conversation

n2ygk
Copy link
Contributor

@n2ygk n2ygk commented Jun 7, 2019

Fixes #657

Description of the Change

DRF 3.10 milestone has dropped the @list_route and @detail_route decorators and replaced them with @action(detail=False) or @action(detail=True) which was added in DRF 3.8.

This fix handles both DRF<=3.7 and >=3.8 cases.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@n2ygk n2ygk requested a review from sliverc June 7, 2019 18:02
@n2ygk
Copy link
Contributor Author

n2ygk commented Jun 7, 2019

@sliverc any idea why the codecov statuses appear to be stuck?

@n2ygk n2ygk force-pushed the issue-657/drf_decorators branch from a160bdf to 08cb73f Compare June 9, 2019 17:23
@codecov
Copy link

codecov bot commented Jun 9, 2019

Codecov Report

Merging #659 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
- Coverage   96.15%   96.14%   -0.02%     
==========================================
  Files          57       56       -1     
  Lines        2889     2876      -13     
==========================================
- Hits         2778     2765      -13     
  Misses        111      111
Impacted Files Coverage Δ
example/api/resources/identity.py 100% <100%> (ø) ⬆️
example/tests/integration/test_polymorphism.py 100% <0%> (ø) ⬆️
example/models.py 100% <0%> (ø) ⬆️
example/migrations/0007_artproject_description.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7abd764...08cb73f. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jun 9, 2019

Codecov Report

Merging #659 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
- Coverage   96.15%   96.14%   -0.02%     
==========================================
  Files          57       56       -1     
  Lines        2889     2876      -13     
==========================================
- Hits         2778     2765      -13     
  Misses        111      111
Impacted Files Coverage Δ
example/api/resources/identity.py 100% <100%> (ø) ⬆️
example/tests/integration/test_polymorphism.py 100% <0%> (ø) ⬆️
example/models.py 100% <0%> (ø) ⬆️
example/migrations/0007_artproject_description.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7abd764...08cb73f. Read the comment docs.

@sliverc
Copy link
Member

sliverc commented Jun 11, 2019

I prefer we start cleaning up what DRF versions DJA supports then working around this issue.

See suggestion in #662 how to go about this.

@sliverc
Copy link
Member

sliverc commented Jul 4, 2019

Closing this PR in favor of #664

@sliverc sliverc closed this Jul 4, 2019
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.

DRF 3.10 deprecated decorators
2 participants