From: jlaine Date: Tue, 3 May 2011 19:41:27 +0000 (+0000) Subject: Do not create tables for LDAP models (thanks Gervase) X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=62d069c59b8ccea19532c7cda599af992b4c7ebe;p=matthijs%2Fupstream%2Fdjango-ldapdb.git Do not create tables for LDAP models (thanks Gervase) git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@1052 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/router.py b/ldapdb/router.py index 5c3a674..ba00631 100644 --- a/ldapdb/router.py +++ b/ldapdb/router.py @@ -54,6 +54,12 @@ class Router(object): self.ldap_alias = alias break + def allow_syncdb(self, db, model): + "Do not create tables for LDAP models" + if is_ldap_model(model): + return db == self.ldap_alias + return None + def db_for_read(self, model, **hints): "Point all operations on LDAP models to the LDAP database" if is_ldap_model(model):