1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Fixed #24266 -- Changed get_parent_list to return a list ordered by MRO.

Thanks to Aron Podrigal for the initial patch and Tim for the review.
This commit is contained in:
Simon Charette
2015-02-03 15:13:43 -05:00
parent 281fc03474
commit 65e005f8cd
3 changed files with 36 additions and 8 deletions

View File

@@ -118,3 +118,20 @@ class Relating(models.Model):
# ManyToManyField to Person
people = models.ManyToManyField(Person, related_name='relating_people')
people_hidden = models.ManyToManyField(Person, related_name='+')
# ParentListTests models
class CommonAncestor(models.Model):
pass
class FirstParent(CommonAncestor):
first_ancestor = models.OneToOneField(CommonAncestor, primary_key=True, parent_link=True)
class SecondParent(CommonAncestor):
second_ancestor = models.OneToOneField(CommonAncestor, primary_key=True, parent_link=True)
class Child(FirstParent, SecondParent):
pass