title: Hard coding if statements in templates
body: <p>I have been working on an e-commerce website for a while. There three types of products there: Clothes, Accessories and Shoes. There is item table and category table. In the category table are the category objects(clothes,accessories, shoes) which maybe in the near future won't be changed. In my case i don't want accessories to have sizes. So when i am rendering the templates i do if statement which checks if the item's category is accessory. If it is I don't render the size field's value(which is null). Everything works good but i think that there is a better way to achieve this functionality without hard coding the if statement. Can you give me an advice for improving the code?</p>
  
  <p>models.py</p>
  
  <pre><code>class ItemCategory(models.Model):
      category = models.CharField(max_length=20)
  
  class Item(models.Model):
      seller = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
      category = models.ForeignKey(ItemCategory, on_delete=models.SET_NULL, null=True)
      brand = models.ForeignKey(Brand, on_delete=models.SET_NULL, null=True)
      price = models.IntegerField(null=True, blank=True)
      price_negotiable = models.BooleanField(default=False)
      discount_price = models.IntegerField(null=True, blank=True)
      size = models.ForeignKey(Size, on_delete=models.SET_NULL, null=True, blank=True)
      condition = models.CharField(choices=CONDITION_CHOICES, max_length=9)
      description = models.CharField(max_length=500)
  
  </code></pre>
  
  <pre><code>{% if item.category.category != 'accessories' %}
      Size: {{ item.size.size }}
  {% endif %}
  </code></pre>