title: for loop iteration in django
body: <p>My coding is:
  views</p>
  
  <pre><code>def showThread(request, thread_id)
      post_list     = Post.objects.filter(id = thread_id)
      post_likes    = PostLikes.objects.all()
      return render_to_response('show.html',locals(),context_instance=RequestContext(request))
  </code></pre>
  
  <p>models:</p>
  
  <pre><code>class Post(models.Model):
          subject = models.CharField(max_length = 250)
          body = models.TextField()
          thread = models.ForeignKey('self', null = True, editable = False )
  </code></pre>
  
  <p>Show.html:</p>
  
  <pre><code>{% for post in post_list %}
     {{post.id}}{{post.subject}}
  {% endfor %}
  {% for post_like in post_likes %}
     {% if post_like.post_id == post.id and post_like.user_id == user.id %} 
           U like this post{{post}}
     {% else %}
           {{post}}
     {% endif %}      
  {% endfor %} 
  </code></pre>
  
  <p>In the show.html, else part, it displays the values again and again. But i need only one time.How can i break the for loop when i enter into else condition.Please help me..</p>