diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-11 10:10:03 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-05-11 10:10:03 +0000 |
| commit | baaf29895c41cfafcd130d5a8f5ab548e5e9c308 (patch) | |
| tree | 4e7862d5d553923f7d411044959541ee7b65e5b7 /django/db/models/options.py | |
| parent | 2b0903b2c4b6f5534e88d25254c6dcf02cc9d485 (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/options.py')
| -rw-r--r-- | django/db/models/options.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index c7ae983541..34dd2aac34 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -461,8 +461,13 @@ class Options(object): if ancestor in self.parents: return self.parents[ancestor] for parent in self.parents: - if parent._meta.get_ancestor_link(ancestor): - return self.parents[parent] + # Tries to get a link field from the immediate parent + parent_link = parent._meta.get_ancestor_link(ancestor) + if parent_link: + # In case of a proxied model, the first link + # of the chain to the ancestor is that parent + # links + return self.parents[parent] or parent_link def get_ordered_objects(self): "Returns a list of Options objects that are ordered with respect to this object." |
