projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't forget to use offset/limit in get_count()
[matthijs/upstream/django-ldapdb.git]
/
ldapdb
/
models
/
query.py
diff --git
a/ldapdb/models/query.py
b/ldapdb/models/query.py
index 07a6312bc182f2e6d3cb240f8198b204758df9e8..3076e3f3364905bf2a272be6ad31934641cde093 100644
(file)
--- a/
ldapdb/models/query.py
+++ b/
ldapdb/models/query.py
@@
-211,7
+211,15
@@
class Query(BaseQuery):
)
except ldap.NO_SUCH_OBJECT:
return 0
)
except ldap.NO_SUCH_OBJECT:
return 0
- return len(vals)
+
+ number = len(vals)
+
+ # apply limit and offset
+ number = max(0, number - self.low_mark)
+ if self.high_mark is not None:
+ number = min(number, self.high_mark - self.low_mark)
+
+ return number
def get_compiler(self, using=None, connection=None):
return Compiler(self, ldapdb.connection, using)
def get_compiler(self, using=None, connection=None):
return Compiler(self, ldapdb.connection, using)