super(Query, self).__init__(*args, **kwargs)
self.connection = ldapdb.connection
- def get_count(self):
+ def get_count(self, using=None):
filterstr = ''.join(['(objectClass=%s)' % cls for cls in self.model.object_classes])
sql, params = self.where.as_sql()
filterstr += sql
filterstr = '(&%s)' % filterstr
try:
- vals = self.connection.search_s(
+ vals = ldapdb.connection.search_s(
self.model.base_dn,
ldap.SCOPE_SUBTREE,
filterstr=filterstr,