title: How can I access an attribute of a model which is a foreignkey to another model in the views.py file
body: <p>For example I have two models .Brand model which is a foreign key to another model Item. The Brand  model has an attribute best_seller which is a boolean field recording whether a certain brand of items is a best seller. In my views I want to filter only the items whose brand is a best seller.How can I do this</p>
  <p>This is how my models.py looks like</p>
  <pre><code>class Brand(models.Model):
  title = models.CharField(max_length=100)
  best_seller = models.BooleanField(default=False)
  
  def __str__ (self):
      return self.title
  
  
  class Item(models.Model):
  title = models.CharField(max_length=100)
  category = models.ForeignKey(Category, on_delete=models.CASCADE)
  brand = models.ForeignKey(Brand, on_delete=models.CASCADE)
  new_price = models.DecimalField(max_digits=7, decimal_places=2)
  image = models.ImageField(upload_to='static/images')
  old_price = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)
  slug = models.SlugField()
  description = models.TextField()
  featured = models.BooleanField(default=False)
  
  def __str__ (self):
      return self.title
  </code></pre>
  <p>Then this the views.py file</p>
  <pre><code>def home(request):
  brand = Brand.objects.filter(best_seller=True)
  bests = Item.objects.filter(brand=True).order_by('-id')[:12]
  context = {
      'items': items,
      'bests': bests
  }
  return render(request, 'home.html', context)
  </code></pre>
  <p>After doing this there's nothing being rendered on the browser</p>