don't patch get_query_set for abstract classes
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Wed, 2 Sep 2009 08:30:25 +0000 (08:30 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Wed, 2 Sep 2009 08:30:25 +0000 (08:30 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@550 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/base.py

index cdc44e21fc4e32869dc0c49043951a88f130f102..44d495b22716cd4266e3e7f3e18d415fca0e6652 100644 (file)
@@ -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