title: Django Accessing Parent Data in templates from child data
body: <p>So I've been search and trying to solve this question for hours and hours and I cant' seem to find an answer.</p>
  <p>I have 2 different models flights and Destinations. The Destination is the Parent model, A flight can only have one destination but the Destination can have many flights (one to many relationship).</p>
  <p>I would like to access this parent model on the details page of of the flight model. This details page is generated via the url routing and the slug of the flight. Here is what I have for the for the models, views and templates.</p>
  <p>models:</p>
  <pre><code>class Flight(models.Model):
      title = models.CharField( null=True, max_length=60, blank=True)
      slug = models.SlugField(max_length=100, null=True, blank=True)
      flight_destination = models.ForeignKey(Destination, null=True, blank=True, on_delete=models.SET_NULL)
  
  class Destination(models.Model):
  
      title = models.CharField( null=True, max_length=60, blank=True)
      featuredimage = models.ImageField(null=True, blank=True, upload_to ='media/')
      slug = models.SlugField(max_length=100, null=True, blank=True)
  </code></pre>
  <p>Each of these classes has an id for its primary key and I've connected all my flights to the correct destination.</p>
  <p>Here is what I have for my view.</p>
  <pre><code>def flight_detail(request, slug):
      
      return render(request,&quot;flight/detail.html&quot;,context= {'flight': Flight.objects.get(slug=slug), 'destination': Destination.objects.filter(id= Flight.objects.get(slug=slug).flight_destination_id)})
  </code></pre>
  <p>Here is the template but it which doesn't throw an error but it displays nothing</p>
  <pre><code>&lt;h3 class=&quot;pb-3&quot;&gt;
   {{ destination.title }}
  &lt;/h3&gt;
  </code></pre>
  <p>I feel like this should be an extremely common question with tons of straight forward answers but I can't seem to find anything. Any help would be greatly appreciated.</p>