#10808: Multiple inheritance (model-based) broken for __init__ of common fields in diamond inheritance ---------------------------------------------------+------------------------ Reporter: mikemintz | Owner: jianhuang Status: assigned | Milestone: Component: Database layer (models, ORM) | Version: SVN Resolution: | Keywords: Stage: Ready for checkin | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------------------------+------------------------ Comment (by lsaffre):
Patch 10808.diff fixes only one symptom, not the real problem. The real problem is that in case of diamond inheritance there are duplicate field definitions. My patch 10808b.diff won't fix the real problem, but another symptom: when the top-level model of your diamond structure contains a ForeignKey, then you get problems when trying to create inline formsets. To show this problem I added a "Owner" class to SmileyChris's diamond inheritance test. inlineformset_factory() gets disturbed because it thinks that PizzeriaBar contains more than one foreign key to Owner. The workaround is to specify the fk_name explicitly when calling inlineformset_factory(). Unfortunately this workaround needs another patch because inlineformset_factory() just can't imagine that a model can have two fields with the same name. Patch 10808b.diff contains 10808.diff + my suggestion. -- Ticket URL: <http://code.djangoproject.com/ticket/10808#comment:11> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---