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

Fixed #30382 -- Allowed specifying parent classes in force_insert of Model.save().

This commit is contained in:
Akash Kumar Sen
2023-06-22 18:23:11 +05:30
committed by Mariusz Felisiak
parent 601ffb0da3
commit a40b0103bc
6 changed files with 138 additions and 5 deletions

View File

@@ -30,3 +30,13 @@ class SubSubCounter(SubCounter):
class WithCustomPK(models.Model):
name = models.IntegerField(primary_key=True)
value = models.IntegerField()
class OtherSubCounter(Counter):
other_counter_ptr = models.OneToOneField(
Counter, primary_key=True, parent_link=True, on_delete=models.CASCADE
)
class DiamondSubSubCounter(SubCounter, OtherSubCounter):
pass