diff options
author | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-04-02 15:36:31 +0000 |
---|---|---|
committer | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-04-02 15:36:31 +0000 |
commit | a3053273c8a5d450a0cd73ee8deebc277d8c4170 (patch) | |
tree | 040ebe76a8c7814e888c6669deec86d6c7ef8940 /django/db | |
parent | b86d69f52920adf8e065bf6952ab6b3814211d4e (diff) | |
download | django-a3053273c8a5d450a0cd73ee8deebc277d8c4170.tar.gz |
boulder-oracle-sprint: Merged to [4905].
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4906 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db')
-rw-r--r-- | django/db/models/base.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index ed7f484626..eb95aae4f2 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -22,7 +22,12 @@ 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 name == 'Model' or not filter(lambda b: issubclass(b, Model), bases): + try: + if not filter(lambda b: issubclass(b, Model), bases): + return super(ModelBase, cls).__new__(cls, name, bases, attrs) + except NameError: + # 'Model' isn't defined yet, meaning we're looking at Django's own + # Model class, defined below. return super(ModelBase, cls).__new__(cls, name, bases, attrs) # Create the class. |