title: Django Querying Relation
body: <p>the code did not return all of the item's name based on employee..? how to solve this probem? did the models wrong? or the query?</p>
  
  <p><strong>MODELS.PY</strong>    </p>
  
  <pre><code>class Employee(models.Model):
      name = models.CharField(max_length=100)
      telephone_number = models.CharField(max_length=20)
      address = models.TextField()
      email = models.EmailField()
  
  
  class Item(models.Model):
      code = models.CharField(max_length=4)
      name = models.CharField(max_length=100)
      kind = models.CharField(max_length=100)
      description = models.TextField()
  
  
  class Inventory(models.Model):
      employee = models.ForeignKey(Employee, on_delete=models.CASCADE)
      item = models.ForeignKey(Item, on_delete=models.CASCADE)
  
      def get_absolute_url(self):
          return reverse('inventaris-detail', kwargs={'pk': self.pk})
  </code></pre>
  
  <p><strong>VIEWS.PY</strong>
  <em>how can i get all of the employee's item ?</em></p>
  
  <pre><code>query_set = Inventory.objects.all()
  
      for query in query_set:
          output.append([
              query.employee.name,
              query.item.name
          ])
  </code></pre>
  
  <p>i need something like <code>query.employee.items_set.all()</code> .. ?</p>