title: Accessing the first object in list to have an optional property in a Django template
body: <p>I'm trying to implement various <a href="http://schema.org" rel="nofollow">schema.org</a> tags on a website run by Django. For pages tied to a specific article or item there's an obvious choice for the cover image, but for list pages there is not. </p>
  
  <p>The models for the objects I have lists of each have a <code>cover_image</code> property, but it can be null. I'd get the cover image property for the first object in the list using <a href="https://stackoverflow.com/questions/1479206/django-templating-how-to-access-properties-of-the-first-item-in-a-list"><code>{{list.0.cover_image}}</code></a>, but the first object may or may not actually have a cover image, in which case it would return null. </p>
  
  <p>Is there a way to get a given property from the first object in a list that has a value for that property?</p>