﻿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
28834	Fields cache should attempt to follow ancestor links on lookup failures	Simon Charette	Simon Charette	"Given the following models

{{{#!python
class Chef(model.Model):
    pass

class Restaurant(models.Model):
    chef = models.ForeignKey(Chef)

class ItalianRestaurant(Restaurant):
    pass
}}}

Then given `restaurant.chef` is cached accessing `restaurant.italianrestaurant.chef` shouldn't incur an additional query. e.g.

{{{#!python
chef = Chef.objects.create()
italian_restaurant = ItalianRestaurant.objects.create(chef=chef)
# A single query with two joins
restaurant = Restaurant.objects.select_related('chef', 'italianrestaurant').get(pk=italian_restaurant.pk)
assert restaurant.chef == chef  # Currently no queries.
assert restaurant.italian_restaurant == italian_restaurant  # Currently no queries.
assert restaurant.italian_restaurant.chef is restaurant.chef  # Currently fails and performs a query.
}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
