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.

app.py 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. from django.conf.urls import url, include
  2. from oscar.core.application import Application
  3. from oscar.core.loading import get_class
  4. class DashboardApplication(Application):
  5. name = 'dashboard'
  6. permissions_map = {
  7. 'index': (['is_staff'], ['partner.dashboard_access']),
  8. }
  9. index_view = get_class('dashboard.views', 'IndexView')
  10. reports_app = get_class('dashboard.reports.app', 'application')
  11. orders_app = get_class('dashboard.orders.app', 'application')
  12. users_app = get_class('dashboard.users.app', 'application')
  13. catalogue_app = get_class('dashboard.catalogue.app', 'application')
  14. promotions_app = get_class('dashboard.promotions.app', 'application')
  15. pages_app = get_class('dashboard.pages.app', 'application')
  16. partners_app = get_class('dashboard.partners.app', 'application')
  17. offers_app = get_class('dashboard.offers.app', 'application')
  18. ranges_app = get_class('dashboard.ranges.app', 'application')
  19. reviews_app = get_class('dashboard.reviews.app', 'application')
  20. vouchers_app = get_class('dashboard.vouchers.app', 'application')
  21. comms_app = get_class('dashboard.communications.app', 'application')
  22. shipping_app = get_class('dashboard.shipping.app', 'application')
  23. def get_urls(self):
  24. urls = [
  25. url(r'^$', self.index_view.as_view(), name='index'),
  26. url(r'^catalogue/', include(self.catalogue_app.urls)),
  27. url(r'^reports/', include(self.reports_app.urls)),
  28. url(r'^orders/', include(self.orders_app.urls)),
  29. url(r'^users/', include(self.users_app.urls)),
  30. url(r'^content-blocks/', include(self.promotions_app.urls)),
  31. url(r'^pages/', include(self.pages_app.urls)),
  32. url(r'^partners/', include(self.partners_app.urls)),
  33. url(r'^offers/', include(self.offers_app.urls)),
  34. url(r'^ranges/', include(self.ranges_app.urls)),
  35. url(r'^reviews/', include(self.reviews_app.urls)),
  36. url(r'^vouchers/', include(self.vouchers_app.urls)),
  37. url(r'^comms/', include(self.comms_app.urls)),
  38. url(r'^shipping/', include(self.shipping_app.urls)),
  39. ]
  40. return self.post_process_urls(urls)
  41. application = DashboardApplication()