title: How comment_set.all is used to get data from model where it doen't exist?
body: <p>In the HTML comment_set.all is used to get data from model where it doesn't exist. What is the concept behind this.</p>
  
  <p><strong>post_detail.html</strong></p>
  
  <pre><code>{% extends "base.html" %}
  ...
  &lt;div&gt;
          {{ instance.comment_set.all }}
  &lt;/div&gt;
  ...
  </code></pre>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>[&lt;Comment: User_Name &gt;]
  </code></pre>
  
  <p>Codes that supporting this</p>
  
  <p>Comments app model is given below</p>
  
  <p><strong>comments/models.py</strong></p>
  
  <pre><code>from django.conf import settings
  from django.db import models
  # Create your models here.
  from posts.models import Post
  
  class Comment(models.Model):
      user        = models.ForeignKey(settings.AUTH_USER_MODEL, default=1)
      post        = models.ForeignKey(Post)
      content     = models.TextField()
      timestamp   = models.DateTimeField(auto_now_add=True)
      def __str__(self):
         return str(self.user.username)
  </code></pre>
  
  <p><strong>posts/models.py</strong></p>
  
  <pre><code>...
  class Post(models.Model):
      user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1)
      title = models.CharField(max_length=120)
      slug = models.SlugField(unique=True)
      image = models.ImageField(upload_to=upload_location, 
              null=True, 
              blank=True, 
              width_field="width_field", 
              height_field="height_field")
      height_field = models.IntegerField(default=0)
      width_field = models.IntegerField(default=0)
      content = models.TextField()
      draft = models.BooleanField(default=False)
      publish = models.DateField(auto_now=False, auto_now_add=False)
      updated = models.DateTimeField(auto_now=True, auto_now_add=False)
      timestamp = models.DateTimeField(auto_now=False, auto_now_add=True)
  
      objects = PostManager()
  
      def __str__(self):
          return self.title
  
      def get_absolute_url(self):
          return reverse("posts:detail", kwargs={"slug": self.slug})
  
      class Meta:
          ordering = ["-timestamp", "-updated"]
  
      def get_markdown(self):
          content = self.content
          markdown_text = markdown(content)
          return mark_safe(markdown_text)
  ...
  </code></pre>
  
  <p><strong>posts/views.py</strong></p>
  
  <pre><code>...
  def post_detail(request, slug=None):
      instance = get_object_or_404(Post, slug=slug)
      if instance.publish &gt; timezone.now().date() or instance.draft:
          if not request.user.is_staff or not request.user.is_superuser:
              raise Http404
      share_string = quote_plus(instance.content)
      context = {
          "title": instance.title,
          "instance": instance,
          "share_string": share_string,
      }
      return render(request, "post_detail.html", context)
  ...
  </code></pre>
  
  <p>Note in the views.py the posts_detail.html is rendered through post_detail() 
  but, in the posts_detail.html we are accessing data of comments in it. How this is possible, since there is no foreign key in posts/models.py to the  Comment in comments/models.py </p>