Opened 7 years ago
Closed 7 years ago
#28382 closed Bug (fixed)
BaseExpression.output_field should not be set after BaseExpression._resolve_output_field() fails
Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In [1]: from django.db.models.expressions import Value, Func In [2]: from django.db.models import IntegerField, FloatField In [3]: expr = Func(Value(1, output_field=IntegerField()), Value(1, output_field=FloatField())) In [4]: expr.output_field # raises FieldError In [5]: expr.output_field Out[5]: <django.db.models.fields.IntegerField>
Change History (2)
comment:1 by , 7 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
PR