Replies: 3 comments
-
|
Is there more to the error? Post the entire stack trace. I use the same setup in one of my apps, and have not encountered this. |
Beta Was this translation helpful? Give feedback.
-
class Subscriptible(PolymorphicModel):
subscribers = djm.ManyToManyField(User)
class Postable(PolymorphicModel):
author = djm.ForeignKey(settings.AUTH_USER_MODEL)
class Answer(Postable, Subscriptible):
pass
Issue #429 could be relevant |
Beta Was this translation helpful? Give feedback.
-
|
@MiltosD Multiple inheritance from concrete models does work in Django - you have to manually specify and deconflict the primary key field names. django-polymorphic does not yet support multiple inheritance. There are a few issues to resolve (namely the ctype conflict you highlight) - but it is on the list. For now, you would need to make all but one parent abstract. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
class A(PolymorphicModel)
class B(PolymorphicModel)
class C(B)
class D(A, C)
When trying to make migrations for class D, I get the following
The field 'polymorphic_ctype' from parent model 'A' clashes with the field 'polymorphic_ctype' from parent model 'B'.
Is there any way to differentiate between those two?
Beta Was this translation helpful? Give feedback.
All reactions