distinct not working
nickappel opened this issue · 4 comments
nickappel commented
on the following code:
Product.objects.distinct('categories')
I keep on getting this error
in check_query raise DatabaseError("This query is not supported by the database.")
DatabaseError: This query is not supported by the database.
When I check the files in the package I can find the distinct() query
I run:
mongo-engine 0.5.2
djangotoolbox 1.6.2
Alir3z4 commented
@nickappel Have you set MongoDBManager
as the model manager for Product
?
class Product(models.Model):
####
objects = MongoDBManager()
nickappel commented
@Alir3z4 No I have not. I am trying to find some documentation on how to set the MongoDBManager because MongoDBManager is not defined. Do you have a url for me?
Alir3z4 commented
Sure, check the docs:
http://django-mongodb-engine.readthedocs.org/en/latest/reference/lowerlevel.html