summaryrefslogtreecommitdiff
path: root/tests/model_meta/models.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-02-03 15:13:43 -0500
committerSimon Charette <charette.s@gmail.com>2015-02-03 16:40:31 -0500
commit65e005f8cd9c656e558e53e6c8b890cd0fcc9e74 (patch)
tree99f147451d6fad705dd66e2fbdc4001bcbd23cb0 /tests/model_meta/models.py
parent281fc03474ac18c8281ed4cf289128c87bda2030 (diff)
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.
Diffstat (limited to 'tests/model_meta/models.py')
-rw-r--r--tests/model_meta/models.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/model_meta/models.py b/tests/model_meta/models.py
index ab9713dc38..b4ed9f89d2 100644
--- a/tests/model_meta/models.py
+++ b/tests/model_meta/models.py
@@ -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