hey guys i have these models
class Product(models.Model):
.......
class Course(Product):
.........
class Book(Product):
.........
class Cart(models.Model):
product = models.ForeignKey(Product)
what I want is to prefetch the products with the Cart objects i know we can do this
Cart.objects.select_related('product')
but how do we also get the product to children too without making an impact on the performance and if i get it's children how can get it's child when accessing the product like:
cart_instance.product.its_child