﻿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
18580	"Avoiding SQLite update+annotations ""only a single result allowed for a SELECT that is part of an expression"""	Jonas H.	nobody	"When executing something like

{{{
Foo.objects.annotate(bar_count=Count('bars')) \
           .update(spam=42)
}}}

SQLite throws an `only a single result allowed for a SELECT that is part of an expression` error.

This can be worked around using `.values('id')`:


{{{
Foo.objects.annotate(bar_count=Count('bars')) \
           .values('id') \
           .update(spam=42)
}}}

Looks like SQLite can't cope with multiple fields in the `SELECT` clause, so I suggest not `SELECT`ing all the fields if we don't need them anyways (as in this case)."	Bug	closed	Database layer (models, ORM)	1.4	Normal	fixed			Accepted	0	0	0	0	0	0
