﻿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
31486	Deprecate passing unsaved objects to related filters.	Mapiarz	raydeal	"Consider this filter:
{{{
Foo.objects.filter(related_obj=bar)
}}}
Where 'bar' is an unsaved object instance. In Django 1.11, this would always return an empty QuerySet (since no Foo object is related to unsaved 'bar'). In Django 2.0 through 2.2, this is equivalent to doing (which can return a non-empty QuerySet):
{{{
Foo.objects.filter(related_obj=None)
}}}

I found a somewhat related issue that touches on this subject: https://code.djangoproject.com/ticket/27985

My questions:
1. What is the intended behaviour? In the aforementioned issue Simon Charette suggests that unsaved objects should be prevented from being used in related filters. I agree with that.
2. Is this documented anywhere? I couldn't find anything. At the very least this should be documented somewhere."	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		Simon Charette	Ready for checkin	1	0	0	0	0	0
