#30382: force_insert flag is not passed when saving parents on inherited models.
-------------------------------------+-------------------------------------
Reporter: Phill Tornroth | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Akash Kumar Sen):
* status: new => closed
* resolution: => fixed
Comment:
This issue seems to be closed on
https://github.com/django/django/commit/6b4834952dcce0db5cbc1534635c00ff8573a6d8
. Tested this with the current main with the following test.
{{{
class Counter(models.Model):
name = models.CharField(max_length=10)
value = models.IntegerField()
class SubCounter(Counter):
pass
def test_force_insert_on_im(self):
a = Counter(id=1, name="Counter", value=3).save()
a = SubCounter(id=1, name="Subcounter",
value=2).save(force_insert=True)
cntr = Counter.objects.first()
subcntr = SubCounter.objects.first()
self.assertEqual(subcntr.name, cntr.name)
self.assertEqual(subcntr.value, cntr.value)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30382#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070187da9d53b9-f73396d2-6eed-4de6-a5f2-b5f72f5de78a-000000%40eu-central-1.amazonses.com.