Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- class Collection(models.Model):
- name = models.CharField(max_length=50)
- prod_category = models.CharField(max_length=50)
- description = models.TextField()
- manufacturer = models.TextField()
- num_products = models.IntegerField()
- image_url = models.URLField()
- from oscar.apps.catalogue.abstract_models import AbstractProduct
- class Product(AbstractProduct):
- collection = models.ForeignKey(Collection, on_delete=models.CASCADE)
- multiplier = models.DecimalField(max_digits=2, decimal_places=1)
- from oscar.apps.catalogue.models import *
- Running migrations:
- Applying catalogue.0014_auto_20181211_1617...Traceback (most recent call last):
- File "/home/mysite/lib/python3.7/Django-2.1.3-py3.7.egg/django/db/backends/utils.py", line 85, in _execute
- return self.cursor.execute(sql, params)
- psycopg2.IntegrityError: insert or update on table "catalogue_product" violates foreign key constraint "catalogue_product_collection_id_e8789e0b_fk_catalogue"
- DETAIL: Key (collection_id)=(1) is not present in table "catalogue_collection".
Add Comment
Please, Sign In to add comment