-
Notifications
You must be signed in to change notification settings - Fork 439
Avoid fetching table data in duplicate from ListView mixin #986
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
base: master
Are you sure you want to change the base?
Conversation
|
The normal implementation of ListView fills beside the variable |
I'm trying to understand this, but grep is being uncooperative. Are you perchance referring to |
|
I mean, if I have a ListView for the model |
| from django.core.exceptions import ImproperlyConfigured | ||
| from django.views.generic.list import ListView | ||
| from django.views.generic.list import ( | ||
| MultipleObjectMixin as ConfoundingMultipleObjectMixin, |
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.
What is the reason for the alias? Can't we just do from django.views.generic.list import ListView, MultipleObjectMixin?
| similar, as presumably ListView.get_context_data is meant to fetch the | ||
| same data as this function will fetch directly. | ||
| """ | ||
| context = ( |
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.
If there are multiple overrides of get_context_data, this could skip more than just the MultipleObjectMixin.get_context_data that this PR tries to skip.
I feel as if the current implementation could have unintended breaking side-effects.
Fixes #914. Thank you for your consideration.