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 750B

12345678910111213141516171819202122232425
  1. from django.conf.urls import patterns, url
  2. from oscar.views.decorators import staff_member_required
  3. from oscar.core.application import Application
  4. from oscar.apps.dashboard.communications import views
  5. class CommsDashboardApplication(Application):
  6. name = None
  7. list_view = views.ListView
  8. update_view = views.UpdateView
  9. def get_urls(self):
  10. urlpatterns = patterns('',
  11. url(r'^$', self.list_view.as_view(), name='comms-list'),
  12. url(r'^(?P<code>\w+)/$', self.update_view.as_view(),
  13. name='comms-update'),
  14. )
  15. return self.post_process_urls(urlpatterns)
  16. def get_url_decorator(self, url_name):
  17. return staff_member_required
  18. application = CommsDashboardApplication()