Replies: 2 comments
-
|
I demonstrate this with: jedie@adb038b A test output looks like: https://travis-ci.org/django-polymorphic/django-polymorphic/jobs/623225731#L320-L338 |
Beta Was this translation helpful? Give feedback.
-
|
@jedie This may have been a django issue in <=2.x? It looks like you were "downcasting" the original row by creating child rows, using pks that reference the parent. When I do this on 4.2+ I get unique constraint errors - presumably because django is trying to create parent rows using the taken pk. Even if you were still allowed to do this, an exception would no longer be raised on fetch thanks to #752 and #785 We also now offer a convenience function for "downcasting". See create_from_super. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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_togethercontraints between the primary key andpolymorphic_ctype, isn't it?Beta Was this translation helpful? Give feedback.
All reactions