﻿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
4212	badly-defined ForeignKey to self does not cause an exception	Forest Bond <forest@…>	Jonas Obrist	"I have a model something like this:

{{{

class MyModel(models.Model):
    my_model = ForeignKey('MyModel')

}}}

This mostly works, but I was confused when I found that instances didn't have a my_model_set attribute.  I found that I should've defined my model like this:

{{{

class MyModel(models.Model):
    my_model = ForeignKey('self')

}}}

I can do that just fine, of course, but it was a bit non-obvious what the problem was.  It'd be nice if defining that relationship improperly threw an exception."	Bug	closed	Database layer (models, ORM)	dev	Normal	invalid			Accepted	0	0	0	0	0	0
