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.

123456789101112131415161718192021222324252627
  1. from django.conf.urls import patterns, url
  2. from django.contrib.admin.views.decorators import staff_member_required
  3. from django.utils.translation import ugettext_lazy as _
  4. from oscar.core.application import Application
  5. from oscar.apps.dashboard.reports import views
  6. from oscar.apps.dashboard.nav import register, Node
  7. node = Node(_('Reports'), 'dashboard:reports-index')
  8. register(node, 90)
  9. class ReportsApplication(Application):
  10. name = None
  11. index_view = views.IndexView
  12. def get_urls(self):
  13. urlpatterns = patterns('',
  14. url(r'^$', self.index_view.as_view(), name='reports-index'),
  15. )
  16. return self.post_process_urls(urlpatterns)
  17. def get_url_decorator(self, url_name):
  18. return staff_member_required
  19. application = ReportsApplication()