diff --git a/django_mongodb_engine/__init__.py b/django_mongodb_engine/__init__.py index 355b484e..4984238f 100644 --- a/django_mongodb_engine/__init__.py +++ b/django_mongodb_engine/__init__.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -__version__ = (0, 4, 0, 'bigml-2') +__version__ = (0, 4, 0, 'bigml-3') __author__ = "Flavio Percoco Premoli, Alberto Paro, " + \ "Jonas Haag and contributors" __contact__ = "django-non-relational@googlegroups.com" diff --git a/django_mongodb_engine/compiler.py b/django_mongodb_engine/compiler.py index 045db790..9e7a576a 100644 --- a/django_mongodb_engine/compiler.py +++ b/django_mongodb_engine/compiler.py @@ -84,9 +84,10 @@ def fetch(self, low_mark, high_mark): @safe_call def count(self, limit=None, with_limit_and_skip=False): results = self._get_results() - if limit is not None: - results.limit(limit) - return results.count(with_limit_and_skip=True) + ################################# + # Put 10000 hard-limit on count # + ################################# + return results.limit(10000).count(with_limit_and_skip=True) @safe_call def order_by(self, ordering):