Closed slinkp closed 11 years ago
(In [9a402a11a3cf823d5a2a18ac6e6c673dcf5f417e]) Merged: Fix #146: breakage was introduced in changeset a11a8b00 when we added a default ORDER BY to NewsItemQuerySet. This had side effect of adding a spurious GROUP BY in the top_lookups query, which caused multiple rows in a subquery, which is an error.
Ticket imported from Trac: http://developer.openblockproject.org/ticket/146 Reported by: slinkp
Example: http://demo.openblockproject.org/api/place-lookup-chart/?sf=7&pid=l:50
This comment is pretty clearly relevant, I suspect that something about upgrading to Django 1.2 changed such that the .values() hack no longer has the intended effect:
For reference, the SQL query generated by all this looks like (formatted for "readability"):
The error happens when there's more than one row in the (...) AS "item_count" subquery.
Trying to see if I can get the tests to reproduce this.