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 |
0 replies
|
@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. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?All reactions