RuntimeError:在应用程序'catalog'中冲突'product_product_options'模型 [英] RuntimeError: Conflicting 'product_product_options' models in application 'catalogue'
问题描述
版本信息
Python 3.4,Django 1.8,Oscar Commerce - VERSION =(1,2,1,'final')
Version Info: Python 3.4, Django 1.8, Oscar Commerce - VERSION = (1, 2, 1, 'final')
我试图在产品 1.1 / howto / how_to_customise_models.htmlrel =nofollow>文档。
I am trying to customize Products
in the catalogue app following the documentation.
分配了目录
应用程序,我已经定义了 models.py
如下:
Having forked the catalogue
app, I have defined models.py
as follows:
from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct
class Product(AbstractProduct):
is_active = models.BooleanField(default=False)
from oscar.apps.catalogue.models import *
我已经在 INSTALLED_APPS
中包含修改的目录 settings.py
作为列表,建议类似的问题这里。
I have already included the modified catalogue, in the INSTALLED_APPS
in settings.py
as a list, as suggested for a similar problem here.
INSTALLED_APPS = INSTALLED_APPS + get_core_apps(
['app.gravytrain.catalogue',])
从 oscar / apps / catalog
到我的自定义应用程序。
但运行迁移会导致以下错误:
Have copied the migration folder from oscar/apps/catalogue
to my custom app.
However running migration causes the following error:
RuntimeError: Conflicting 'product_product_options' models in
application 'catalogue': <class
'gravytrain.catalogue.models.Product_product_options'> and <class
app.gravytrain.catalogue.models.Product_product_options'>.
如何解决此错误?
推荐答案
我有同样的错误。我还在模型的顶部包括from oscar.apps.catalogue.models import *。一旦我被删除,这个问题解决了。
I had the same error. I have also included "from oscar.apps.catalogue.models import *" in the top of the model. Once I was removed it, that issue fixed.
这篇关于RuntimeError:在应用程序'catalog'中冲突'product_product_options'模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!