Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2363 -- Fixed subclass checking in ModelBase to allow for mixin

superclasses. Thanks phil.h.smith@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4607 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c27ba0b2097267796bc97daea81ee62dd10554ff 1 parent 83da190
Malcolm Tredinnick authored February 26, 2007
1  AUTHORS
@@ -149,6 +149,7 @@ answer newbie questions, and generally made Django that much better:
149 149
     pgross@thoughtworks.com
150 150
     phaedo <http://phaedo.cx/>
151 151
     phil@produxion.net
  152
+    phil.h.smith@gmail.com
152 153
     Gustavo Picon
153 154
     Luke Plant <http://lukeplant.me.uk/>
154 155
     plisk
4  django/db/models/base.py
@@ -22,8 +22,8 @@ class ModelBase(type):
22 22
     "Metaclass for all models"
23 23
     def __new__(cls, name, bases, attrs):
24 24
         # If this isn't a subclass of Model, don't do anything special.
25  
-        if not bases or bases == (object,):
26  
-            return type.__new__(cls, name, bases, attrs)
  25
+        if name == 'Model' or not filter(lambda b: issubclass(b, Model), bases):
  26
+            return super(ModelBase, cls).__new__(cls, name, bases, attrs)
27 27
 
28 28
         # Create the class.
29 29
         new_class = type.__new__(cls, name, bases, {'__module__': attrs.pop('__module__')})

0 notes on commit c27ba0b

Please sign in to comment.
Something went wrong with that request. Please try again.