0
votes

i have three types of products Course,Book, Paint, and i have A Cart and CartItem models,i was thinking of using multitable inheritance in Django which will be something like this:

class Product(models.Model):
    name = models.CharField(max_lenght=50)
    ......
class Course(Product):
    ......
class Book(Product):
  ......
class Cart(models.Model):
  .....
class CartItem(models.Model):
   cart = models.ForeignKey(Cart)
   product = models.ForeignKey(Product)

but i was reading that multitable inheritance is not good to use due to it's impact on the performance, so what's the best approach to deal with this?