On Tuesday 13 June 2017 09:54:03 Hyunsoo Kim wrote:
> This doc
> <https://docs.djangoproject.com/en/1.11/topics/db/models/#multiple-inh
> eritance> says multiple inheritance with a common ancestor can do the
> job. However, I've experienced an error while making migrations.
> Here's the error message.
> 
> > models.E005: The field '*<common-ancestor>*_ptr' from parent model '
> > *<myapp>.<parent-1>*' clashes with the field
> > '*<common-ancestor>_*ptr' from parent model '*<myapp>.<parent-2>*'.
> 
> After some googling, I fount this stackoverflow Q&A
> <https://stackoverflow.com/questions/31118645/django-multiple-inherita
> nce-e005> .
> This solves the problem by create an explicit different parent_link in
> parent model to prevent collision.
> But it seems redundant to hold two multiple ancestor link in the child
> model.
> Is there any solution with no redundant field?

Sorry, but you haven't convinced us you've implemented the common ancestor part 
properly. It 
means you have at minimum 4 models in play and none of them can be abstract.
The most common error is to mark the grandparent abstract and this copies the 
autofield to 
it's children instead of having a shared parent link.

Gotta say though, that the docs are sparse.
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2782183.1hTYnGWm04%40devstation.
For more options, visit https://groups.google.com/d/optout.

Reply via email to