title: Display Django model data to table in HTML
body: <p>I have two Django models that record time. <strong>Model one records time during the morning</strong> and <strong>Model two records time during the evening</strong>. I want to present both of these times along with the difference between the times within an HTML table but am confused about how to do it. I am new to Django and would really appreciate some advice.</p>
  
  <p>This is what I have so far:</p>
  
  <p><strong>models.py:</strong></p>
  
  <pre><code>class Alltime(models.Model):
      id= models.ForeignKey(User, on_delete = models.CASCADE)
      mtime = models.DateTimeField()
      etime = models.DateTimeField()
  </code></pre>
  
  <p><strong>views.py:</strong></p>
  
  <pre><code>def panel(request):
      time_data = User.objects.filter(pk__gt=1) #I need all data except for the default Super User account
      get_time = Alltime.objects.all()
      return render(request, 'users/interface.html', {'data': time_data, "get_time": get_time})
  </code></pre>
  
  <p><strong>panel.html:</strong></p>
  
  <pre><code>&lt;form&gt;
  {% csrf_token %}
  &lt;table&gt;
  &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Morning timeE&lt;/th&gt; 
      &lt;th&gt;Evening time&lt;/th&gt;
      &lt;th&gt;Difference in hours&lt;/th&gt;
  &lt;/tr&gt;
      {% for data in data %}
  &lt;tr&gt;
      &lt;td&gt;{{data.username}}&lt;/td&gt;
      {% endfor %}
      {% if get_time %}
          {% for m in get_time %}
              &lt;td&gt;{{m.mtime}}&lt;/td&gt;
              &lt;td&gt;{{m.etime}}&lt;/td&gt;
          {% endfor %}
      {% else %}
          &lt;td&gt; Not available &lt;/td&gt;
      {% endif %}
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How can I get the difference between the times and place them within the HTML table?</p>