title: Django html IF statement not comparing model variables
body: <p>Trying to nest an IF statement in FOR loops to segment videos by a parent variable. However, my if statement doesn't seem to be recognising matches.</p>
  
  <p>I can confirm that both output some matching numbers in their respective statements individually.
  Not sure what I'm missing here, any help would be appreciated.</p>
  
  <p><strong>Profile.html</strong></p>
  
  <pre><code>{% for x in source %}
      &lt;div class="content-section"&gt;
        &lt;div class="media-body"&gt;
        &lt;h2 class="account-heading"&gt;{{ x.video_id }}&lt;/h2&gt;
        {% for y in records %}
          &lt;h1 class="text-secondary"&gt;{{ y.sourcevideo.video_id }}&lt;/h1&gt;
          {% if '{{ x.video_id }}' == '{{ y.sourcevideo.video_id }}' %}
            &lt;video width="320" height="240" controls&gt;
              &lt;source src="{{ y.highlight }}" type="video/mp4"&gt;
                Your browser does not support the video tag
              &lt;/video&gt;
          {% else %}
          &lt;h1 class="text-secondary"&gt;No Matches&lt;/h1&gt;
          {% endif %}
        {% endfor %}
        &lt;/div&gt;
      &lt;/div&gt;
    {% endfor %}
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class ProfileView(ListView):
      model = Highlight
      template_name = 'users/profile.html'
      context_object_name = 'records'
      ordering = ['-date_created']
  
      @method_decorator(login_required)
      def dispatch(self, *args, **kwargs):
          return super().dispatch(*args, **kwargs)
  
      def get_queryset(self):
          return Highlight.objects.filter(creator=self.request.user)
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          context['source'] = Video.objects.filter(creator=self.request.user)
          return context
  </code></pre>