X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fdjango-ldapdb.git;a=blobdiff_plain;f=ldapdb%2Fmodels%2Fquery.py;h=069c237916f515b8b51bd4c909b5a054bf8cf532;hp=f5c402040f8826ce05a38d5947c30998bbc9591e;hb=b1cc6993cafbf24e8a394d8b9bea1048efa8adc9;hpb=29d308dca099fd6365d272c8a0bb2b8206562f87 diff --git a/ldapdb/models/query.py b/ldapdb/models/query.py index f5c4020..069c237 100644 --- a/ldapdb/models/query.py +++ b/ldapdb/models/query.py @@ -75,11 +75,11 @@ class WhereNode(BaseWhereNode): obj = Constraint(obj.alias, obj.col, obj.field) super(WhereNode, self).add((obj, lookup_type, value), connector) - def as_sql(self, qn=None): + def as_sql(self, qn=None, connection=None): bits = [] for item in self.children: - if isinstance(item, WhereNode): - sql, params = item.as_sql() + if hasattr(item, 'as_sql'): + sql, params = item.as_sql(qn=qn, connection=connection) bits.append(sql) continue