summaryrefslogtreecommitdiff
path: root/django/db/models/base.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-05-11 10:10:03 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-05-11 10:10:03 +0000
commitbaaf29895c41cfafcd130d5a8f5ab548e5e9c308 (patch)
tree4e7862d5d553923f7d411044959541ee7b65e5b7 /django/db/models/base.py
parent2b0903b2c4b6f5534e88d25254c6dcf02cc9d485 (diff)
Fixed #10953, #10955: proxies of proxies now work correctly, though I still don't quite understand why you'd want to do such a thing. Thanks, Armin Ronacher.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/base.py')
-rw-r--r--django/db/models/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 05cd0d9ea1..3a3fbf16ac 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -116,6 +116,8 @@ class ModelBase(type):
new_class._meta.local_many_to_many):
raise FieldError("Proxy model '%s' contains model fields."
% name)
+ while base._meta.proxy:
+ base = base._meta.proxy_for_model
new_class._meta.setup_proxy(base)
# Do the appropriate setup for any model parents.
@@ -123,6 +125,7 @@ class ModelBase(type):
if isinstance(f, OneToOneField)])
for base in parents:
+ original_base = base
if not hasattr(base, '_meta'):
# Things without _meta aren't functional models, so they're
# uninteresting parents.
@@ -167,7 +170,7 @@ class ModelBase(type):
# Proxy models inherit the non-abstract managers from their base,
# unless they have redefined any of them.
if is_proxy:
- new_class.copy_managers(base._meta.concrete_managers)
+ new_class.copy_managers(original_base._meta.concrete_managers)
# Inherit virtual fields (like GenericForeignKey) from the parent
# class