title: django how to get field from child relationship into parent template
body: <p>If I have a one-to-many relationship model. How do i display items from the related child table in my parent template.</p>
  
  <p>models.py</p>
  
  <pre><code>class Parent(models.Model):
      name = models.CharField()
  
  class Child(models.Model):
      parent = models.ForeignKey(Parent)
      child_name = models.CharField()
  </code></pre>
  
  <p>parent.html</p>
  
  <pre><code>{% for parent in parents %}
  
              &lt;tr&gt;
                  &lt;td&gt;&lt;a href="/get/parent/{{ parent.id }}/"&gt;{{ parent.id }}&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="/parent/get/{{ parent.id }}/"&gt;{{ parent.name }}&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="/parent/get/{{ parent.id }}/"&gt;{{ child.child_name }}&lt;/a&gt;&lt;/td&gt;
              &lt;/tr&gt;
  
              {% endfor %}
  </code></pre>