mirror of
https://github.com/django/django.git
synced 2025-08-24 20:44:24 +00:00
Fixed #31659 -- Made ExpressionWrapper preserve output_field for combined expressions.
Regression in df32fd42b8
.
Thanks Simon Charette for the review.
This commit is contained in:
parent
5776a1660e
commit
aeb8996a67
3 changed files with 14 additions and 1 deletions
|
@ -857,6 +857,9 @@ class ExpressionWrapper(Expression):
|
|||
|
||||
def __init__(self, expression, output_field):
|
||||
super().__init__(output_field=output_field)
|
||||
if getattr(expression, '_output_field_or_none', True) is None:
|
||||
expression = expression.copy()
|
||||
expression.output_field = output_field
|
||||
self.expression = expression
|
||||
|
||||
def set_source_expressions(self, exprs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue