From 9c4c98c24a7c0300ba09218b12833426d9bbb88f Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 11 Apr 2011 10:33:31 +0000 Subject: [PATCH] actually register database git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@1024 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ldapdb/__init__.py b/ldapdb/__init__.py index 765bb5e..7dde301 100644 --- a/ldapdb/__init__.py +++ b/ldapdb/__init__.py @@ -33,7 +33,7 @@ # from django.conf import settings -from ldapdb.backends.ldap.base import DatabaseWrapper +from django.db import connections def escape_ldap_filter(value): value = unicode(value) @@ -43,9 +43,11 @@ def escape_ldap_filter(value): .replace(')', '\\29') \ .replace('\0', '\\00') -# FIXME: is this the right place to initialize the LDAP connection? -connection = DatabaseWrapper({ +# Add the LDAP backend to the configured databases +settings.DATABASES['ldap'] = { + 'ENGINE': 'ldapdb.backends.ldap', 'NAME': settings.LDAPDB_SERVER_URI, 'USER': settings.LDAPDB_BIND_DN, - 'PASSWORD': settings.LDAPDB_BIND_PASSWORD}, 'ldap') + 'PASSWORD': settings.LDAPDB_BIND_PASSWORD} +connection = connections['ldap'] -- 2.30.2