#27408: Make QuerySet.bulk_create() populate fields on related models
-------------------------------------+-------------------------------------
Reporter: Jarek Glowacki | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bulk_create foreign | Triage Stage:
key id | Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jarek Glowacki):
I believe you're referring to this: #9553
The proposed solution there was to proactively update all instances that
had the just-saved instance as an FK. Big change, probably could hit
performance pretty hard in some situations.
If we want to solve this in the general case I'd be more inclined to just
use a fallback in the field descriptor's `__get__`, so that we're not
updating instances that might not end up getting accessed.
It's tricky, because the general case really wouldn't benefit much from
this, other than keeping things consistent. Hence I thought it might be
better to focus on just making it work for `bulk_create` (maybe with an
explicitly set flag even, to make it obvious).
I'll try both approaches over the weekend and see if I can come up with
something nice.
--
Ticket URL: <https://code.djangoproject.com/ticket/27408#comment:6>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.afc334bafaab7eb6dda4e0be028c3b57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.