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.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. def get_urls(self):
  23. urls = [
  24. url(r'^$', self.index_view.as_view(), name='index'),
  25. url(r'^catalogue/', include(self.catalogue_app.urls)),
  26. url(r'^reports/', include(self.reports_app.urls)),
  27. url(r'^orders/', include(self.orders_app.urls)),
  28. url(r'^users/', include(self.users_app.urls)),
  29. url(r'^content-blocks/', include(self.promotions_app.urls)),
  30. url(r'^pages/', include(self.pages_app.urls)),
  31. url(r'^partners/', include(self.partners_app.urls)),
  32. url(r'^offers/', include(self.offers_app.urls)),
  33. url(r'^ranges/', include(self.ranges_app.urls)),
  34. url(r'^reviews/', include(self.reviews_app.urls)),
  35. url(r'^vouchers/', include(self.vouchers_app.urls)),
  36. url(r'^comms/', include(self.comms_app.urls)),
  37. ]
  38. return self.post_process_urls(urls)
  39. application = DashboardApplication()