我正在尝试扩展 Oscar 应用程序,所以我分叉了它。现在按照此示例行并尝试将字段添加到ProductImage
Model 类。
from oscar.apps.catalogue.abstract_models import AbstractProductImage
class ProductImage(AbstractProductImage):
thumbnail = models.ImageField(upload_to='images/thumbnails/')
from oscar.apps.catalogue.models import *
我得到了runserver
错误
RuntimeError: Conflicting 'productimage' models in application
'catalogue': <class 'oscar.apps.catalogue.models.ProductImage'>
and <class 'forked_apps.catalogue.models.ProductImage'>.
我知道如果我将类的名称更改为其他名称,ProductImage
这将起作用,但为什么在示例中它们使用相同的名称呢?同样在未来假设我想分叉任何我想将字段添加到现有类而不是新类的应用程序。有什么我想念的吗?