From 2f694dd1b92b972dcf0ae4077ffc2d7a0cb2dcbd Mon Sep 17 00:00:00 2001 From: javinp Date: Fri, 5 Jun 2020 10:24:21 +0200 Subject: [PATCH] Revert commit df1d052 --- django_mongodb_engine/__init__.py | 2 +- django_mongodb_engine/compiler.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/django_mongodb_engine/__init__.py b/django_mongodb_engine/__init__.py index 4984238f..4c112c2c 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-3') +__version__ = (0, 4, 0, 'bigml-4') __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 9e7a576a..a91a8596 100644 --- a/django_mongodb_engine/compiler.py +++ b/django_mongodb_engine/compiler.py @@ -84,10 +84,15 @@ 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) + #return results.limit(10001).count(with_limit_and_skip=True) @safe_call def order_by(self, ordering):