fix ordering on int fields
[matthijs/upstream/django-ldapdb.git] / ldapdb / __init__.py
index 767e6a9fc3030a7dfe6363e7f337e39f2054a8f5..0db12a1705d5a5eaf7dfe8b19f05bc24959c2158 100644 (file)
@@ -23,17 +23,6 @@ import ldap
 from django.conf import settings
 from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations
 
-def convert(field, value, func):
-    # FIXME : we should not reference the attribute name!
-    if not value or field == 'jpegPhoto':
-        return value
-    elif isinstance(value, int):
-        return str(value)
-    elif isinstance(value, list):
-        return [ func(x) for x in value ]
-    else:
-        return func(value)
-
 def escape_ldap_filter(value):
     value = str(value)
     return value.replace('\\', '\\5c') \
@@ -89,8 +78,6 @@ class LdapConnection(object):
         results = cursor.connection.search_s(base, scope, filterstr.encode(self.charset), attrlist)
         output = []
         for dn, attrs in results:
-            for field in attrs:
-                attrs[field] = convert(field, attrs[field], lambda x: x.decode(self.charset))
             output.append((dn.decode(self.charset), attrs))
         return output