mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
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
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user