Skip to content

Store initkwargs as view class attribute for schema discovery. #4467

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

kmmbvnr
Copy link

@kmmbvnr kmmbvnr commented Sep 5, 2016

I have a problem with schema discovery. Mine get_queryset implementation of generic views requires some attributes pre-set for the view, that happens in .as_view method. But as_view attributes is lost, if the APIView used. Currently, rest_framework keeps initkwargs only for views created from a Viewset.

This change makes API Views consistent with views from Viewsets during API schema discovery

@tomchristie
Copy link
Member

Thanks for raising this. Resolved via #4527. Now in the version-3-5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants