﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16944	multiple inheritance issue	pegler@…	nobody	"Django's support for multiple inheritance from several non-abstract models seems to almost be working.  When both parent models have the same name for their PK, saving will update a related row instead of insert a new one.

Scenario:

Model: Pet - pk: id
Model: Mammal -  pk: id
Model: Cat - inherits from Pet and Mammal, pk on the 2 foreign keys

Cat.save()  will first insert a Pet row, since id isn't yet set.  It will then set Cat.id to the new id values from Pet.  It will then try to save Mammal, but since id has been set from Pet, it will try to update/insert a Mammal row (instead of always inserting).

The code at fault is here: https://code.djangoproject.com/browser/django/tags/releases/1.3.1/django/db/models/base.py#L492

I am not sure of the best solution for this, but perhaps not setting attributes that are also primary keys of other parent models."	Bug	closed	Database layer (models, ORM)	1.3	Normal	duplicate			Unreviewed	0	0	0	0	0	0
