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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user