Skip to content

Conversation

mShan0
Copy link
Contributor

@mShan0 mShan0 commented Aug 29, 2024

Fixes a bug when using the .explain() function, see #409

Co-Authored-By: evan54 <[email protected]>
@@ -361,7 +361,7 @@ def as_sql(self, with_limits=True, with_col_aliases=False):
params.extend(h_params)

explain = self.query.explain_info if django.VERSION >= (4, 0) else self.query.explain_query
if explain:
if explain and hasattr(self.query, 'explain_format'):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, so from what I understand after Django 4.0 query.explain_format and query.explain_options are replaced by query.explain_info.format and query.explain_info.options respectively.

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