#24997: Allow bulk_create with proxy inheritance -------------------------------------+------------------------------------- Reporter: wkschwartz | Owner: nobody Type: New feature | Status: new Component: Database layer | Version: 1.8 (models, ORM) | Severity: Normal | Resolution: Keywords: proxy, inheritance, | Triage Stage: Accepted bulk_create, queryset, insert | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by akaariai): One possible approach is that we change bulk_create()'s approach to be "save the objects to the database using fastest method available". We could add a couple of flags, too, for example signals=True/False and with_pk=True/False. The defaults would be False and False. Then we would check if the given database can do a fast bulk-insert, or if we need to switch to a loop with obj.save(force_insert=True). I guess the biggest problem is that it might be a bit surprising if bulk_create doesn't do the insert in bulk. But even then, the current alternative is to do the insert by a loop of save() calls, and that is exactly what you will get from the updated bulk_create. For example in fixture loading it would be very convenient if one could always call bulk_create(), and get the fastest possible bulk insert for the given model class and database backend combination. -- Ticket URL: <https://code.djangoproject.com/ticket/24997#comment:3> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.50f3750c5d707179d173f3c58cfa01d6%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.