﻿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
24687	select_related field validation doesn't work for nested non-relation fields	Tim Graham	Tim Graham	"The validation added in #10414 only occurs if the field is on the immediate model, or if it's invalid:

{{{#!python

>>> Person.objects.select_related('foo')
django.core.exceptions.FieldError: Invalid field name(s) given in select_related: 'foo'. Choices are: hometown
>>> Person.objects.select_related('hometown__foo')
django.core.exceptions.FieldError: Invalid field name(s) given in select_related: 'foo'. Choices are: mayor
>>> Person.objects.select_related('hometown__name')
# query = select ... blah
[ Person object ...]
>>> Person.objects.select_related('name')
django.core.exceptions.FieldError: Non-relational field given in select_related: 'name'. Choices are: hometown

}}}

Notice how it will happily accept the third one.  Failing test attached."	Bug	closed	Database layer (models, ORM)	1.8	Normal	fixed		github@…	Ready for checkin	1	0	0	0	0	0
