Failing testcase:
{{{
parent = NoFields()
child = NullableFields(auto_field=parent)
NoFields.objects.bulk_create([parent])
NullableFields.objects.bulk_create([child])
child.refresh_from_db()
self.assertEqual(child.auto_field, parent)
}}}
This behaviour was also described in
https://code.djangoproject.com/ticket/29497 but might’ve been missed when
closed as a duplicate.
My proposal is to extract the code in `Model.save()` which ensures that
all fields are in sync before save to it’s own method which can then be
used by `bulk_update`.
--
Ticket URL: <https://code.djangoproject.com/ticket/32133>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/13589
--
Ticket URL: <https://code.djangoproject.com/ticket/32133#comment:1>