1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #31660 -- Fixed queryset crash when grouping by m2o relation.

Regression in 3a941230c8.

Thanks Tomasz Szymański for the report.
This commit is contained in:
Mariusz Felisiak
2020-06-08 07:21:54 +02:00
committed by GitHub
parent 07506a6114
commit 78ad4b4b02
3 changed files with 30 additions and 4 deletions

View File

@@ -383,7 +383,9 @@ class BaseExpression:
Custom format for select clauses. For example, EXISTS expressions need
to be wrapped in CASE WHEN on Oracle.
"""
return self.output_field.select_format(compiler, sql, params)
if hasattr(self.output_field, 'select_format'):
return self.output_field.select_format(compiler, sql, params)
return sql, params
@cached_property
def identity(self):