django-polymorphic icon indicating copy to clipboard operation
django-polymorphic copied to clipboard

Bulk create support

Open tng10 opened this issue 8 years ago • 6 comments

Hi guys,

There's a ticket that already solved a problem for normal inheritance classes in django (https://code.djangoproject.com/ticket/24997), but in django_polymorphic it doesn't work.

Is there anyone facing the same problem?

Thanks in advance!

tng10 avatar Mar 29 '16 15:03 tng10

Any idea?

tng10 avatar Apr 12 '16 15:04 tng10

I'm not sure why it fails, but this likely needs some support to fix the polymorphic_ctype field that we assign during .save().

vdboor avatar May 04 '16 09:05 vdboor

Thanks @vdboor I will check this out!

tng10 avatar May 05 '16 18:05 tng10

Did anyone make any progress on this? It would be great to be able to bulk_create.

MightySCollins avatar Jul 13 '17 10:07 MightySCollins

I started working on this. I will make a pull request soon.

krzysztofgromadzki avatar Dec 30 '17 11:12 krzysztofgromadzki

What's the current status of this functionality? I see a PR was merged, but the documentation still states

https://django-polymorphic.readthedocs.io/en/stable/api/polymorphic.managers.html

Multi-table models are not supported.

Experimenting on my own, it seems that it can create the base model part of an object, but not the inherited part.


Never mind, that PR seems consistent with Django's documentation, that multi-table inheritance doesn't work with this.

AlanCoding avatar Feb 12 '20 13:02 AlanCoding