title: Access object attributes in Django template
body: <p>I would like to achieve something that in python looks like this:</p>
  
  <pre><code>person = Person.name('Thomas')
  </code></pre>
  
  <p>In my views.py I'm passing every <code>People</code> object that matches the query and list with few names. Then, I want to access specific object and it's fields, i.e. sex, age, city of this particular person. So far I've tried defining custom filter like this:</p>
  
  <pre><code>@register.filter(name='people_attributes')
  def object_attributes(val):
      return Person.objects.get(name=val)
  </code></pre>
  
  <p>My goal is to be able to loop over list with values and then, during every iteration, access coresponding object. Let's say, my list looks like <code>['John', 'Adam', 'Alice', 'Katherine']</code>, I want to access object which <code>name</code> attribute is equal to John, Adam, Alice or Katherine.</p>