Skip to content

Conversation

charettes
Copy link
Owner

This will allow to differentiate between sealed queryset that would benefit from prefetching many-to-many relationships and the ones that don't.

In other words, warning about N+1 query issues when fetching a many-to-many relationship from a singular result (.get(), .first()) is arguably bad practice as it could be beneficial to defer the fetching. This is a common scenario when seal()'ing a queryset meant to be used both by singular (detail view) and multiple results (list view) code paths.


This paves the way for addressing #44 but it will likely need to be opt-in through a setting to maintain backward compatibility.

This will allow to differentiate between sealed queryset that would benefit
from prefetching many-to-many relationships and the ones that don't.

In other words, warning about N+1 query issues when fetching a many-to-many
relationship from a singular result (.get(), .first()) is arguably bad practice
as it could be beneficial to defer the fetching. This is a common scenario when
seal()'ing a queryset meant to be used both by singular (detail view) and
multiple results (list view) code paths.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 99.157% when pulling dbd2ec9 on seal-origin into 75c1697 on master.

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.

2 participants