Eliminate BogusQuerySet

Review Request #155 — Created Sept. 22, 2007 and submitted


Review Board SVN (deprecated)


For a while now, we've been using a stupid object I wrote called "BogusQuerySet" which would make a list look like a QuerySet object.  This really limited us in terms of sorting and ordering, but it was necessary because the "incoming reviews" dashboard page couldn't be created without it.

The reason behind this was that the OR operator on Q() objects was really dumb when it encountered a foreign key, and used an inner join.  This meant that instead of getting a union of everything, it gave some random collection of relations within the database.

Fortunately, some awesome person on djangosnippets.com write a Q implementation called QLeftOuterJoins which does what we want!  This lets us use an actual QuerySet, which means less code and much better performance.  Woo!
Ran tests for the reviews module.  Also created a test database with a bunch of groups and reviews which pointed both to my user and those groups.  Saw a correct dashboard.