title: Django template using _set.all
body: <p>I'm working on building a Django app for tracking fiber optic cables. I am running into a problem with what I believe is the relatedmanager, in that in some templates I can get it to do what I want but in others I can't.</p>
  
  <p>A working example of what I'm trying to do:</p>
  
  <pre><code>&lt;ul&gt;
      {% for lanroom in building.lanroom_set.all %}
      &lt;li&gt;&lt;a href="/lanrooms/{{ lanroom.id }}/"&gt;{{ lanroom.lan_room_name }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>What this does is gives me the set of LAN rooms that have the building being viewed in detail as a foreign key.</p>
  
  <p>What I am trying to do is have a strand of cable be connected to an adaptor plate connector. So that template has the following:</p>
  
  <pre><code>&lt;li&gt;Date Added: {{ adaptorplateconnector.date_added }}&lt;/li&gt;
  &lt;li&gt;Connector Type in {{ adaptorplateconnector }}:&lt;/li&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="/connectortypes/{{ adaptorplateconnector.connector_type_id.id }}/"&gt;{{ adaptorplateconnector.connector_type_id.type }}&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;li&gt;Strand connected to  {{ adaptorplateconnector }}:
  &lt;ul&gt;
      {% for strand in adaptorplateconnector.strand_set.all %}
      &lt;ali&gt;&lt;a href="/strands/{{ strand.id }}/"&gt;{{ strand }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>Yet I am not getting any strands that are connected to the adaptor plate connector. Here are the relevant models:</p>
  
  <pre><code>class AdaptorPlateConnector(models.Model):
      adaptor_plate_id = models.ForeignKey('AdaptorPlate')
      connector_type_id = models.ForeignKey('ConnectorType')
      strand_position = models.CharField(max_length=200)
      date_added = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
          return self.strand_position
  
  class Strand(models.Model):
      cable_id = models.ForeignKey('Cable')
      end1_plate_connector_id = models.ForeignKey('AdaptorPlateConnector', related_name= 'end1_adaptor_plate_connector')
      end2_plate_connector_id = models.ForeignKey('AdaptorPlateConnector', related_name= 'end2_adaptor_plate_connector')
      in_use = models.CharField(max_length=200)
      desc = models.CharField(max_length=200)
      date_added = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
          return "End1: " + self.end1_plate_connector_id.__unicode__() + ", End2: " + self.end2_plate_connector_id.__unicode__() + ", Cable: " + self.cable_id.__unicode__()
  </code></pre>
  
  <p>How can I get the list of strands that relate to the AdaptorPlateConnector being viewed in detail? Any insight would be much appreciated. I am using generic views, and this template is for a DetailView</p>