You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 909B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import django
  2. from oscar.core.loading import is_model_registered
  3. from oscar.apps.analytics.abstract_models import (
  4. AbstractProductRecord, AbstractUserRecord,
  5. AbstractUserProductView, AbstractUserSearch)
  6. __all__ = []
  7. if not is_model_registered('analytics', 'ProductRecord'):
  8. class ProductRecord(AbstractProductRecord):
  9. pass
  10. __all__.append('ProductRecord')
  11. if not is_model_registered('analytics', 'UserRecord'):
  12. class UserRecord(AbstractUserRecord):
  13. pass
  14. __all__.append('UserRecord')
  15. if not is_model_registered('analytics', 'UserProductView'):
  16. class UserProductView(AbstractUserProductView):
  17. pass
  18. __all__.append('UserProductView')
  19. if not is_model_registered('analytics', 'UserSearch'):
  20. class UserSearch(AbstractUserSearch):
  21. pass
  22. __all__.append('UserSearch')
  23. if django.VERSION < (1, 7):
  24. from . import receivers # noqa