Как отобразить продукт нескольких моделей в модели, используя внешний ключ или что-то еще
Я хочу отображать свои предложения продуктов и месячные планы в единой модели Theres products и monthly plan model
class Monthlyplan(models.Model):
...
name = models.CharField(max_length=220)
class Product(models.Model):
...
name = models.CharField(max_length=220)
class Customers(models.Model):
product = models.ForeignKey(Product, on_delete=models.CASCADE)
monthly_plan = models.ForeignKey(Monthlyplan, on_delete=models.CASCADE)
Packages = GenericForeignKey('product', 'frozen_food')
error
core.Customers.Packages: (contenttypes.E004) 'Customers.product' is not a ForeignKey to 'contenttypes.ContentType'.
HINT: GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field.