mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #33414 -- Fixed creating diamond-shaped MTI objects for common ancestor with primary key that has a default.
Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
1c4f5f314e
commit
5d20e02078
@@ -186,3 +186,23 @@ class Child(Parent):
|
||||
|
||||
class GrandChild(Child):
|
||||
pass
|
||||
|
||||
|
||||
class CommonAncestor(models.Model):
|
||||
id = models.IntegerField(primary_key=True, default=1)
|
||||
|
||||
|
||||
class FirstParent(CommonAncestor):
|
||||
first_ancestor = models.OneToOneField(
|
||||
CommonAncestor, models.CASCADE, primary_key=True, parent_link=True
|
||||
)
|
||||
|
||||
|
||||
class SecondParent(CommonAncestor):
|
||||
second_ancestor = models.OneToOneField(
|
||||
CommonAncestor, models.CASCADE, primary_key=True, parent_link=True
|
||||
)
|
||||
|
||||
|
||||
class CommonChild(FirstParent, SecondParent):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user