MongoEngine/mongoengine — pull request #59 by peterlandry (2012-08-03 23:52:45+00:00)
Title: Fix for distinct when using db_alias on Documents

Not positive if this is the best way to approach it, but adding a document scope to dereferencing seemed reasonable. It could maybe also allow some simplifications elsewhere in dereference.py?