は、私自身の証券を選択するための戦略と価格を宣言した私はカタログのアプリで作成したカスタムモデルクラスをインポートする必要があったまで、すべてがうまく働きました。 私の目標は、価格選択戦略のためにこのカスタムモデルにアクセスすることでした。oscar.partnerアプリの戦略モジュールにモデルを正しくインポートする方法は? <a href="http://django-oscar.readthedocs.io/en/releases-1.1/topics/prices_and_availability.html" rel="nofollow">http://django-oscar.readthedocs.io/en/releases-1.1/topics/prices_and_availability.html</a></p> <p>で説明したように、私が定義した
私はこのようなモデルをインポートしようとした/apps/partner/strategy
で
:
CountrySpecificProductInformation = get_model('catalogue', 'CountrySpecificProductInformation')
この呼び出しはモデルではない登録例外発生します
File "/home/matyas/virtenvs/oscar/local/lib/python2.7/site-packages/oscar/core/loading.py", line 250, in get_model
return apps.get_registered_model(app_label, model_name)
File "/home/matyas/virtenvs/oscar/local/lib/python2.7/site-packages/django/apps/registry.py", line 260, in get_registered_model
"Model '%s.%s' not registered." % (app_label, model_name))
LookupError: Model 'catalogue.CountrySpecificProductInformation' not registered.
を自分のインストール済みのアプリケーションの設定は次のようになります。
INSTALLED_APPS = ['...'] +
oscar.get_core_apps(['apps.catalogue', 'apps.promotions', 'apps.dashboard',
'apps.dashboard.catalogue', 'apps.partner', 'apps.payment', 'apps.dashboard.partners',
'apps.shipping', 'apps.checkout', 'apps.search'])
私は使用していますdjango-oscar 1.3とDjango 1.9.9