From: jlaine Date: Wed, 2 Sep 2009 08:30:25 +0000 (+0000) Subject: don't patch get_query_set for abstract classes X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=a8d4fb785850a8c5fcdb19f3be10f24b4edcfc81;p=matthijs%2Fupstream%2Fdjango-ldapdb.git don't patch get_query_set for abstract classes git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@550 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/models/base.py b/ldapdb/models/base.py index cdc44e2..44d495b 100644 --- a/ldapdb/models/base.py +++ b/ldapdb/models/base.py @@ -40,10 +40,11 @@ class ModelBase(django.db.models.base.ModelBase): new_class = super_new(cls, name, bases, attrs) # patch manager to use our own QuerySet class - def get_query_set(): - return QuerySet(new_class) - new_class.objects.get_query_set = get_query_set - new_class._default_manager.get_query_set = get_query_set + if not new_class._meta.abstract: + def get_query_set(): + return QuerySet(new_class) + new_class.objects.get_query_set = get_query_set + new_class._default_manager.get_query_set = get_query_set if attr_meta: new_class._meta.dn = attr_meta.dn