Sometimes it makes sense to use select_related in a django template. For example, say I have a class extending DetailView
class DemoCarView(DetailView):
How about a simple method on the Car model?
Car
class Car(models.Model): ... def parts_with_manufacturers(self): return self.part_set.select_related('manufacturer')
and then
{% for part in car.parts_with_manufacturers %} <li>{{ part.name }} - {{ part.manufacturer.name }} </li> {% endfor %}