Skip to content

Commit

Permalink
Forced the 10000 hard-limit on all count()
Browse files Browse the repository at this point in the history
Changed version number from 0.4.0.bigml-2 to 0.4.0.bigml-3
Leon Hwang committed Sep 5, 2016
1 parent bd8c71d commit df1d052
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion django_mongodb_engine/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 4 additions & 3 deletions django_mongodb_engine/compiler.py
Original file line number Diff line number Diff line change
@@ -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):

0 comments on commit df1d052

Please sign in to comment.