﻿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
20814	model validation: misleading error message with model inheritance	Shai Berger	nobody	"Consider this little set of models. The idea is that there are ""general"" objects, but some of them are special: Each of the special objects holds pointers to other objects.

{{{#!python
    class General(models.Model):
        name = models.CharField(max_length=30)

    class Special(General):
        pass

    class SpecialDetail(models.Model):
        parent = models.ForeignKey(Special)
        target = models.ForeignKey(General)
}}}

Model validation fails (as it should), but the error message is 
{{{
specialdetail: accessor for field 'parent' clashes with 'Special.specialdetail_set'
}}}
when in fact the clash is with `General.specialdetail_set` generated by the `target` field (and inherited by `Special`). Of course, when isolated like this, it is very easy to spot where the real problem is, but when the models have a little more content in them, this can be (and actually was) quite perplexing.
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	model-validation check	chris.medrela+djangotrac@…	Accepted	1	0	0	0	0	0
