#NEWLINE# def query_as_ldap( query ) : #NEWLINE# #INDENT# if ( hasattr ( query , 'is_empty' ) and query . is_empty ( ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# filterstr = '' . join ( [ ( '(objectClass=%s)' % cls ) for cls in query . model . object_classes ] ) #NEWLINE# ( sql , params ) = where_as_ldap ( query . where ) #NEWLINE# filterstr += sql #NEWLINE# return ( '(&%s)' % filterstr )