﻿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
15146	Reverse relations for unsaved objects include objects with NULL foreign key	treyh	nobody	"Model with '''parent''' relation and '''children''' reverse relation:

{{{
class TestModel(models.Model):
    parent = models.ForeignKey('self', blank=True, null=True, related_name='children')
}}}



Bug found while using model:


{{{
t = TestModel()
t.save()
u = TestModel()
u.children.all() # Incorrectly returns: [<TestModel: TestModel object>]
u.save()
u.children.all() # Correctly returns: []
}}}"	Bug	closed	Database layer (models, ORM)	1.2	Normal	duplicate			Accepted	1	0	0	1	0	0
