Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

superclasses. Thanks

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c27ba0b2097267796bc97daea81ee62dd10554ff 1 parent 83da190
Malcolm Tredinnick malcolmt authored
Showing with 3 additions and 2 deletions.
  1. +1 −0  AUTHORS
  2. +2 −2 django/db/models/
1  AUTHORS
@@ -149,6 +149,7 @@ answer newbie questions, and generally made Django that much better:
phaedo <>
Gustavo Picon
Luke Plant <>
4 django/db/models/
@@ -22,8 +22,8 @@ class ModelBase(type):
"Metaclass for all models"
def __new__(cls, name, bases, attrs):
# If this isn't a subclass of Model, don't do anything special.
- if not bases or bases == (object,):
- return type.__new__(cls, name, bases, attrs)
+ if name == 'Model' or not filter(lambda b: issubclass(b, Model), bases):
+ return super(ModelBase, cls).__new__(cls, name, bases, attrs)
# Create the class.
new_class = type.__new__(cls, name, bases, {'__module__': attrs.pop('__module__')})
Please sign in to comment.
Something went wrong with that request. Please try again.