﻿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
23732	select_related() documentation examples use incorrect fieldnames, and are slightly misleading	Daniele Procida	Tim Graham	"https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_related says that if you have the models

{{{
class City(models.Model):
    # ...
    pass

class Person(models.Model):
    # ...
    hometown = models.ForeignKey(City)

class Book(models.Model):
    # ...
    author = models.ForeignKey(Person)
}}}

then you can do a `Book.objects.select_related('person__city').get(id=4) `.

But in fact that, and the other examples that follow, should be using `select_related('author__hometown')` (the names of the fields, rather than of the models they refer to).

These examples should be changed.

A related issue in the same section: the examples might lead one to believe that `select_related` works only when retrieving a single item with `get()` (unlike `prefetch_related`, whose examples involve retrieving multiple objects), whereas this is not in fact the case. 

An example using `filter()` or some more explicit wording in the description (or both) would help here."	Bug	closed	Documentation	dev	Normal	fixed			Accepted	1	0	0	0	1	0
