benjaoming/django-wiki — pull request #40 by micolous (2012-08-30 01:34:16+00:00)
Title: Fix select_related_common call on EmptyQuerySet (Django 1.5/master), minor optimisation on ACLs (use .exists() instead of bool())

I did a bunch of work on ACLs, then realised I hadn't merged upstream properly. :(

As a result, I've discarded the work I did on this, and now I'm properly aligned with master. The code that was written wasn't much different, however my version did use .exists() on the group query rather than evaluating it to a bool(), which makes it a little faster (it means that you're no longer grabbing a complete copy of a group if a user belongs to that group).

I also identified an issue in UrlPath on Django 1.5, in EmptyQuerySet has no select_related_common(). I've added some extra code to take care of this situation so it will cache an empty list in this case. Django 1.5 returns EmptyQuerySet instead of a complete QuerySet object when there are no results to a query.