- if lookup_type == 'endswith':
- params = ["*%s" % escape_ldap_filter(value)]
- elif lookup_type == 'startswith':
- params = ["%s*" % escape_ldap_filter(value)]
- elif lookup_type == 'contains':
- params = ["*%s*" % escape_ldap_filter(value)]
- elif lookup_type == 'exact':
- params = [escape_ldap_filter(value)]
- elif lookup_type == 'in':
- params = [escape_ldap_filter(v) for v in value]
- else:
- raise TypeError("Field has invalid lookup: %s" % lookup_type)
-