#31967: Django fails with FieldError: Expression contains mixed types:
MoneyField,
IntegerField. You must set output_field.
-------------------------------------+-------------------------------------
Reporter: Matt Hegarty | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):
* cc: Simon Charette (added)
* type: Uncategorized => Bug
* component: Uncategorized => Database layer (models, ORM)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Thanks for this report. It's a regression in
1e38f1191de21b6e96736f58df57dfb851a28c1f but it's not related with fields
subclasses. I was able to reproduce it with a builtin `DecimalField()`,
e.g.
{{{
>>> list(MyModel.objects.annotate(x=Coalesce(F('field_decimal'), 0))
...
File "django/django/db/models/expressions.py", line 306, in
_resolve_output_field
source.__class__.__name__,
django.core.exceptions.FieldError: Expression contains mixed types:
DecimalField, IntegerField. You must set output_field.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31967#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.34764fd69e0a2857f334ce5ddc28ec52%40djangoproject.com.