title: accessing objects stored in dictionary as values using django templatetag outputs only its string representation; not original object
body: <p>in views.py</p>
  
  <p>I am building a dictionary with strings (A1, A2, A3....C10) as keys and database objects  as values.</p>
  
  <pre><code>itemsByPosition = {}
  for storage_instance in StorageInstance.objects.all():
      itemsByPosition[storage_instance.cell] = storage_instance
  </code></pre>
  
  <p>in template, </p>
  
  <p>I would like to display the different fields from objects.
  An isolated, hardcoded example is (In reality I use loops to print entire dictionary): </p>
  
  <pre><code>{{ itemsByPosition|hash:'A2' }}
  </code></pre>
  
  <p>in templatetags.py</p>
  
  <pre><code>def hash(h,key):
      if key in h:
          return h[key]
      else:
         return None
  
  register.filter(hash)
  </code></pre>
  
  <p>However, template tag 'hash' returns the string representation of model (eg: "Stabi00052") not the entire object. I want to be able to access various attributes of this object in the template. </p>