﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28277	Validate that annotate() and aggregate() args and kwarg values are expressions	Tim Graham	Mariusz Felisiak	"The current error messages are unhelpful. For example:
{{{
>>> Book.objects.aggregate(alias=Max('price'), output_field=FloatField())
...
  File ""/home/tim/code/django/django/db/models/sql/query.py"", line 974, in add_annotation
    annotation = annotation.resolve_expression(self, allow_joins=True, reuse=None,
AttributeError: 'FloatField' object has no attribute 'resolve_expression'
}}}
or
{{{
>>> Book.objects.annotate(FloatField()))
  File ""/home/tim/code/django/django/db/models/query.py"", line 890, in annotate
    if arg.default_alias in kwargs:
AttributeError: 'FloatField' object has no attribute 'default_alias'
}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Accepted	1	0	0	0	0	0
