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

add View.init_every_request attribute #4624

Merged
merged 3 commits into from
Jun 6, 2022
Merged

add View.init_every_request attribute #4624

merged 3 commits into from
Jun 6, 2022

Conversation

davidism
Copy link
Member

@davidism davidism commented Jun 6, 2022

If ViewSubclass.init_every_request is set to False, the generated view function will use a single instance of the view class instead of creating a new instance for each request.

Remove the MethodViewType metaclass and use MethodView.__init_subclass__ instead.

Rewrite the docs about class-based views.

fixes #2520

@davidism davidism added this to the 2.2.0 milestone Jun 6, 2022
@davidism davidism merged commit db3187f into main Jun 6, 2022
@davidism davidism deleted the view-init-scope branch June 6, 2022 22:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't create View instances for each request
1 participant