title: get data from multiple models in Django
body: <p>I have 3 models Policy, CustomerAccount, CustomerAccountYourDetails</p>
  
  <p><strong>Policy</strong></p>
  
  <pre><code>class Policy(models.Model):
      date = models.DateTimeField()
      customer_account = models.ForeignKey(CustomerAccount, on_delete=models.CASCADE)
  </code></pre>
  
  <p><strong>CustomerAccount</strong></p>
  
  <pre><code>class CustomerAccount(models.Model):
      username = models.EmailField("Email Address")    
      date_first_registered = models.DateTimeField()
  </code></pre>
  
  <p><strong>CustomerAccountYourDetails</strong></p>
  
  <pre><code>class CustomerAccountYourDetails(models.Model):
      customer_account = models.ForeignKey(CustomerAccount, on_delete=models.CASCADE)    
      first_name = models.CharField("First name", max_length = 30)
      dob = models.DateField("Date of Birth")
  </code></pre>
  
  <p><strong>In views.py function</strong></p>
  
  <pre><code>policies = Policy.objects.all()
  return render(request, 'html file name', 'policies':policies)
  </code></pre>
  
  <p><strong>in html template</strong> </p>
  
  <p>following works</p>
  
  <pre><code>{% for policy in policies %}
  {{policy.date}}  //gives the date as expected
  {{policy.customer_account.username}} //gives the username as expected
  {{need to get first name of customer here}}
  {{need to get dob of customer here}}
  {% endfor %}
  </code></pre>
  
  <p>how can i get the first_name and dob from CustomerAccountYourDetails model which is my third model</p>