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

PolymorphicTypeInvalid if primary key is the same...

Open jedie opened this issue 5 years ago • 1 comments

It's possible to create objects with same primary keys. But it will be raise into:

polymorphic.models.PolymorphicTypeInvalid: ContentType XY for <class 'FooBar'> #XY does not point to a subclass!

So there is not unique_together contraints between the primary key and polymorphic_ctype, isn't it?

jedie avatar Dec 10 '19 15:12 jedie

I demonstrate this with: https://github.com/jedie/django-polymorphic/commit/adb038b1948be467d0b61fc8341c01c775d2cc08

A test output looks like: https://travis-ci.org/django-polymorphic/django-polymorphic/jobs/623225731#L320-L338

jedie avatar Dec 10 '19 15:12 jedie