hmarr/mongoengine — pull request #413 by zmsmith (2012-01-18 17:05:41+00:00)
Title: implement __nonzero__ for querysets

Without __nonzero__ implemented, __len__ is used to boolean testing, which causing count to be called. This is not efficient. We can just check to see any elements exists by looking for the existence of the first element.

Using find_one is probably more efficient, but this was a simpler solution for now.