-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to custom views or models like oscar_fork_app in django-oscar? #57
Comments
It seems like it should work, as https://github.com/django-oscar/django-oscar-accounts/blob/master/src/oscar_accounts/models.py uses I tried it on Oscar 2.0.x and Django 2.2, and it fails. When I modify Traceback (most recent call last):
File "manage.py", line 46, in <module>
main()
File "manage.py", line 42, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/cookie/custom_oscar_apps/oscar_accounts/models.py", line 1, in <module>
from oscar_accounts.models import * # noqa isort:skip
File "/usr/local/lib/python3.6/site-packages/oscar_accounts/models.py", line 6, in <module>
class AccountType(abstract_models.AccountType):
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 95, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class oscar_accounts.models.AccountType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. However if I modify e.g. from oscar_accounts import abstract_models
class AccountType(abstract_models.AccountType):
pass
class Account(abstract_models.Account):
pass
class Transfer(abstract_models.Transfer):
pass
class Transaction(abstract_models.Transaction):
pass
class IPAddressRecord(abstract_models.IPAddressRecord):
pass After that, and forking |
@jayvdb I'am looking for some solution for forking oscar_accounts, but nothing work for me, not even your solution. Do you have any update on this or someone else does? Thx |
Also looking for a solution here. I see the models are dynamically loaded using oscar's get_model. So it seems like I should be able to override them. No luck yet. |
I was wondering if there is a way that I can custom views or models in django-oscar-accounts? Just like oscar_fork_app command in django-oscar.
The text was updated successfully, but these errors were encountered: