title: How can I filter the field so that when I select a category, only those products that belong to this category are displayed?
body: <p>My models, category and product. Each product has a category field, which is linked through ForeignKey.</p>
  <pre><code>class Category(models.Model):
      name = models.CharField(max_length=50, unique=True)
      description = models.TextField()
      image = models.ImageField(upload_to='category', blank=True)
  
      class Meta:
          verbose_name = 'category'
          verbose_name_plural = 'categories'
  
      def __str__(self):
          return self.name
      
  
  class Product(models.Model):
      name = models.CharField(max_length=50, unique=True)
      description = models.TextField()
      category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='category')
      price = models.DecimalField(max_digits=10, decimal_places=2)
      image = models.ImageField(upload_to='product', blank=True)
      stock = models.PositiveIntegerField()
      available = models.BooleanField(default=True)
      created = models.DateTimeField(auto_now_add=True)
      update = models.DateTimeField(auto_now=True)
  
      class Meta:
          verbose_name = 'product'
          verbose_name_plural = 'products'
  
      def __str__(self):
          return self.name
  </code></pre>
  <p>And views, a product category can be selected and when I click on a category, I want the product to appear only in that category</p>
  <pre><code>class CategoriesList(LoginRequiredMixin, ListView):
      login_url = 'login/'
      template_name = 'index.html'
      model = Category
  
  class ProductsList(ListView):
      template_name = 'products.html'
      model = Product
  
      def get_queryset(self):
          return super().get_queryset().filter(category=category_id)
  </code></pre>