use all object classes when performing search
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 18:15:01 +0000 (18:15 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 18:15:01 +0000 (18:15 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@876 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/query.py

index eb35061ca41e5eb889c34d0e0b90c4425ee9f737..f5c402040f8826ce05a38d5947c30998bbc9591e 100644 (file)
@@ -122,8 +122,7 @@ class Query(BaseQuery):
         self.connection = ldapdb.connection
 
     def get_count(self):
-        # FIXME: use all object classes
-        filterstr = '(objectClass=%s)' % self.model.object_classes[0]
+        filterstr = ''.join(['(objectClass=%s)' % cls for cls in self.model.object_classes])
         sql, params = self.where.as_sql()
         filterstr += sql
         filterstr = '(&%s)' % filterstr
@@ -141,8 +140,7 @@ class Query(BaseQuery):
         return len(vals)
 
     def results_iter(self):
-        # FIXME: use all object classes
-        filterstr = '(objectClass=%s)' % self.model.object_classes[0]
+        filterstr = ''.join(['(objectClass=%s)' % cls for cls in self.model.object_classes])
         sql, params = self.where.as_sql()
         filterstr += sql
         filterstr = '(&%s)' % filterstr