#28821: Allow QuerySet.bulk_create() on multi-table inheritance when possible
-------------------------------------+-------------------------------------
     Reporter:  Joey Wilhelm         |                    Owner:  (none)
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Daniel Alley):

 This would be an excellent feature and we would really love to be able to
 use it.

     I would like to be able to manually set the _ptr fields on the child
 records in order to affect a bulk_create without the need for automatic
 retrieval of IDs.

 In certain circumstances (think UUID PKs) it might also be possible, at
 least with Postgresql (don't know about the others), to do it the other
 way around.  Foreign key integrity checks are deferred to the end of the
 transaction, so you could save all of the child tables first, and then
 save all the parent tables.  As long as the entire operation is wrapped in
 a single transaction, it wouldn't matter that `_ptr` temporarily held an
 invalid FK.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28821#comment:5>
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/069.9367abd35b40d39e235777b2fb2ff93d%40djangoproject.com.

Reply via email to