title: Django: using objects.values() and get ForeignKey data in template
body: <p>I have a Django app where my main Model has ForeignKey fields to other DB tables.</p>
  
  <pre><code>class Bugs(models.Model):
      bug_id = models.PositiveIntegerField(primary_key=True)
      bug_severity = models.ForeignKey(Bug_severity,null=True)
      priority = models.ForeignKey(Priority,null=True)
      bug_status = models.ForeignKey(Bug_Status,null=True)
      resolution = models.ForeignKey(Resolution,null=True)
      etc...
  </code></pre>
  
  <p>All of the ForeignKey tables have a unicode function that returns the name that I want displayed in the template.</p>
  
  <pre><code>class Priority(models.Model):
      value = models.CharField(max_length=64)
      sortkey = models.PositiveSmallIntegerField()
      isactive = models.NullBooleanField()
      visibility_value_id = models.SmallIntegerField(null=True,blank=True)
  
      def __unicode__(self):
          return self.value
  </code></pre>
  
  <p>In the view, I am running the query as:</p>
  
  <pre><code>    bugs = Bugs.objects.filter(active=True).order_by('priority__sortkey','bug_severity__sortke
  </code></pre>
  
  <p>In the template, I can iterate through them, and display the ForeignKey value correctly.</p>
  
  <pre><code>{% for bug in bugs %}
     &lt;tr class="bugrow" &gt;
     &lt;td&gt;{{bug.bug_id}}&lt;/td&gt;
     &lt;td&gt;{{bug.priority}}&lt;/td&gt;
     &lt;td&gt;{{bug.bug_severity}}&lt;/td&gt;
     &lt;td&gt;{{bug.bug_status}}&lt;/td&gt;
     &lt;td&gt;{{bug.resolution}}&lt;/td&gt;
  </code></pre>
  
  <p>The problem I am having is that I need to manipulate the Bugs data before sending it to the template, so I use the values() method to return a dictionary.  When I pass that dictionary to the template it does not show any fields that point to a ForeignKey.</p>
  
  <p>I'm pretty sure that the reason is that the values only returns the actual database value, so it cannot follow the FK.</p>
  
  <p>The question is, how can I manipulate the data sending it to the template, and still follow the ForeignKey?</p>