title: Django, how to display comments and replies made on that comment in template
body: <p>I have a comment table which is having a foreign key to <code>Blog</code> table. This table is used to make comments to blog and replies can be made to a comment. For this purpose i have used column <code>parent</code> which will decide to which comment the reply is made.</p>
  
  <p>Now problem is that with object of this table,</p>
  
  <pre><code>comment_obj = comment.objects.filter(blog=blog_obj).order_by("created")
  </code></pre>
  
  <p>i am not getting the desired output. I want to know as how to display comments and under each comment the replies made to that comment.</p>
  
  <p>Models.py:</p>
  
  <pre><code>class Comment(models.Model):
      user = models.ForeignKey(User_info)
      blog = models.ForeignKey(Blog)
      parent = models.ForeignKey('self', null=True)
      comment = models.CharField(max_length=500)
      status = models.CharField(max_length=1, default='A')
      created = models.DateTimeField(auto_now_add=True)
  </code></pre>
  
  <p>template:</p>
  
  <pre><code>{% for comment in comment_obj %}
      &lt;li&gt;
          {{ comment.comment }} - {{ comment.created }}
          {% for reply in comment.Comment_set.all %}
          &lt;ul&gt;
              {{ reply.comment }} - {{ reply.created }}
          &lt;/ul&gt;
         {% endfor %}
      &lt;/li&gt;
      {% endfor %}
  </code></pre>
  
  <p>But this is not working. Please help. I would like to do this without using any app. </p>