title: Django view template can't show model data
body: <p>I defined a Model called Visit. There are several models.</p>
  <p>In models.py</p>
  <pre><code>class Visit(models.Model):
      case = models.ForeignKey(Case, on_delete = models.CASCADE)
      location = models.ForeignKey(Location, on_delete = models.CASCADE)
      date_from = models.DateField()
      date_to = models.DateField()
      category = models.CharField(max_length = 20)
  </code></pre>
  <p>Then, I made a view template. It is to view all the visits made by a specific case.
  So that if the url is &quot;sth/visit/1&quot;, it shows all the visits of case with pk1.</p>
  <p>in views.py</p>
  <pre><code>class VisitView(TemplateView):
      template_name = &quot;visit.html&quot;
      def get_context_data(self, **kwargs):
          case_pk = self.kwargs['case']
          context = super().get_context_data(**kwargs)
          context['visit_list'] = Visit.objects.filter(case = case_pk)
          print(&quot;context[visit_list]: &quot;,context['visit_list'])
  </code></pre>
  <p>I printed the context['visit_list'] in the console
  for url &quot;sth/visit/1&quot;, it shows</p>
  <pre><code>context[visit_list]:  &lt;QuerySet [&lt;Visit: Visit object (1)&gt;, &lt;Visit: Visit object (2)&gt;]&gt;
  </code></pre>
  <p>for url &quot;sth/visit/2&quot;, it shows</p>
  <pre><code>context[visit_list]:  &lt;QuerySet [&lt;Visit: Visit object (3)&gt;]&gt;
  </code></pre>
  <p>so I assume up to this moment, it works.
  but in the html document</p>
  <pre><code>&lt;ul&gt;
  {% for visit in visit_list %}
    &lt;li&gt;[{{visit.date_from }}] {{ visit.date_to }} &lt;/li&gt;
  {% empty %}
    &lt;li&gt;No visit yet.&lt;/li&gt;
  {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  <p>it shows no visit yet. for both 1 and 2. No error message. Just No visit.
  May I know what's the problem? Thank you very much please help TOT. I have been stucking here for several hours.</p>