from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.apps.dashboard.reviews import views node = Node('Reviews', 'dashboard:reviews-list') register(node, 35) class ReviewsApplication(Application): name = None list_view = views.ReviewListView update_view = views.ReviewUpdateView delete_view = views.ReviewDeleteView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='reviews-list'), url(r'^(?P<pk>\d+)/$', self.update_view.as_view(), name='reviews-update' ), url(r'^(?P<pk>\d+)/delete/$', self.delete_view.as_view(), name='reviews-delete' ), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name): return staff_member_required
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.catalogue import views from oscar.apps.dashboard.nav import register, Node node = Node('Catalogue') node.add_child(Node('Products', 'dashboard:catalogue-product-list')) node.add_child(Node('Stock alerts', 'dashboard:stock-alert-list')) register(node, 10) class CatalogueApplication(Application): name = None product_list_view = views.ProductListView product_create_redirect_view = views.ProductCreateRedirectView product_create_view = views.ProductCreateView product_update_view = views.ProductUpdateView stock_alert_view = views.StockAlertListView def get_urls(self): urlpatterns = patterns('', url(r'^products/(?P<pk>\d+)/$', self.product_update_view.as_view(), name='catalogue-product'), url(r'^products/create/$', self.product_create_redirect_view.as_view(), name='catalogue-product-create'), url(r'^products/create/(?P<product_class_id>\d+)/$', self.product_create_view.as_view(), name='catalogue-product-create'),
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.vouchers import views from oscar.apps.dashboard.nav import register, Node node = Node('Vouchers', 'dashboard:voucher-list') register(node, 60) class VoucherDashboardApplication(Application): name = None list_view = views.VoucherListView create_view = views.VoucherCreateView update_view = views.VoucherUpdateView delete_view = views.VoucherDeleteView stats_view = views.VoucherStatsView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.list_view.as_view(), name='voucher-list'), url(r'^create/$', self.create_view.as_view(), name='voucher-create'), url(r'^update/(?P<pk>\d+)/$', self.update_view.as_view(), name='voucher-update'), url(r'^delete/(?P<pk>\d+)/$',
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.users import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Customers'), 'dashboard:users-index') register(node, 30) class UserManagementApplication(Application): name = None index_view = views.IndexView user_detail_view = views.UserDetailView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.index_view.as_view(), name='users-index'), url(r'^(?P<pk>[-\w]+)/$', self.user_detail_view.as_view(), name='user-detail'), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name): return staff_member_required
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.users import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Customers')) node.add_child(Node(_('Customers'), 'dashboard:users-index')) node.add_child(Node(_('Alerts'), 'dashboard:user-alert-list')) #register(node, 30) class UserManagementApplication(Application): name = None index_view = views.IndexView user_detail_view = views.UserDetailView alert_list_view = views.ProductAlertListView alert_update_view = views.ProductAlertUpdateView alert_delete_view = views.ProductAlertDeleteView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.index_view.as_view(), name='users-index'), # Alerts url(r'^alerts/(?P<pk>\d+)/delete/$', self.alert_delete_view.as_view(), name='user-alert-delete'), url(r'^alerts/(?P<pk>\d+)/update/$',
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.reports import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Reports'), 'dashboard:reports-index') register(node, 90) class ReportsApplication(Application): name = None index_view = views.IndexView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.index_view.as_view(), name='reports-index'), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name): return staff_member_required application = ReportsApplication()
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.catalogue import views from oscar.apps.dashboard.nav import register, Node node = Node('Catalogue') node.add_child(Node('Products', 'dashboard:catalogue-product-list')) register(node) class CatalogueApplication(Application): name = None product_list_view = views.ProductListView product_create_redirect_view = views.ProductCreateRedirectView product_create_view = views.ProductCreateView product_update_view = views.ProductUpdateView def get_urls(self): urlpatterns = patterns('', url(r'^products/(?P<pk>\d+)/$', self.product_update_view.as_view(), name='catalogue-product'), url(r'^products/create/$', self.product_create_redirect_view.as_view(), name='catalogue-product-create'), url(r'^products/create/(?P<product_class_id>\d+)/$', self.product_create_view.as_view(), name='catalogue-product-create'), url(r'^$', self.product_list_view.as_view(), name='catalogue-product-list'), ) return self.post_process_urls(urlpatterns)
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.orders import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Orders')) node.add_child(Node(_('Orders'), 'dashboard:order-list')) node.add_child(Node(_('Statistics'), 'dashboard:order-stats')) register(node, 80) class OrdersDashboardApplication(Application): name = None order_list_view = views.OrderListView order_detail_view = views.OrderDetailView shipping_address_view = views.ShippingAddressUpdateView line_detail_view = views.LineDetailView order_stats_view = views.OrderStatsView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.order_list_view.as_view(), name='order-list'), url(r'^statistics/$', self.order_stats_view.as_view(), name='order-stats'), url(r'^(?P<number>[-\w]+)/$', self.order_detail_view.as_view(), name='order-detail'), url(r'^(?P<number>[-\w]+)/notes/(?P<note_id>\d+)/$', self.order_detail_view.as_view(), name='order-detail-note'), url(r'^(?P<number>[-\w]+)/lines/(?P<line_id>\d+)/$',
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.catalogue import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Catalogue')) node.add_child(Node(_('Products'), 'dashboard:catalogue-product-list')) node.add_child(Node(_('Categories'), 'dashboard:catalogue-category-list')) node.add_child(Node(_('Stock alerts'), 'dashboard:stock-alert-list')) register(node, 10) class CatalogueApplication(Application): name = None product_list_view = views.ProductListView product_create_redirect_view = views.ProductCreateRedirectView product_create_view = views.ProductCreateView product_update_view = views.ProductUpdateView category_list_view = views.CategoryListView category_detail_list_view = views.CategoryDetailListView category_create_view = views.CategoryCreateView category_update_view = views.CategoryUpdateView category_delete_view = views.CategoryDeleteView stock_alert_view = views.StockAlertListView
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.offers import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Offers'), 'dashboard:offer-list') register(node, 50) class OffersDashboardApplication(Application): name = None list_view = views.OfferListView metadata_view = views.OfferMetaDataView condition_view = views.OfferConditionView benefit_view = views.OfferBenefitView preview_view = views.OfferPreviewView delete_view = views.OfferDeleteView detail_view = views.OfferDetailView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.list_view.as_view(), name='offer-list'), # Creation url(r'^metadata/$', self.metadata_view.as_view(), name='offer-metadata'),
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.offers import views from oscar.apps.dashboard.nav import register, Node node = Node('Offers') node.add_child(Node('All offers', 'dashboard:offer-list')) register(node, 50) class OffersDashboardApplication(Application): name = None list_view = views.OfferListView metadata_view = views.OfferMetaDataView condition_view = views.OfferConditionView benefit_view = views.OfferBenefitView preview_view = views.OfferPreviewView delete_view = views.OfferDeleteView detail_view = views.OfferDetailView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='offer-list'), # Creation url(r'^metadata/$', self.metadata_view.as_view(), name='offer-metadata'), url(r'^condition/$', self.condition_view.as_view(), name='offer-condition'), url(r'^benefit/$', self.benefit_view.as_view(), name='offer-benefit'), url(r'^preview/$', self.preview_view.as_view(), name='offer-preview'), # Update
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.promotions import views from oscar.apps.promotions.conf import PROMOTION_CLASSES from oscar.apps.dashboard.nav import register, Node node = Node('Content blocks') node.add_child(Node('All blocks', 'dashboard:promotion-list')) node.add_child(Node('By page', 'dashboard:promotion-list-by-page')) register(node) class PromotionsDashboardApplication(Application): name = None list_view = views.ListView page_list = views.PageListView page_detail = views.PageDetailView create_redirect_view = views.CreateRedirectView delete_page_promotion_view = views.DeletePagePromotionView for klass in PROMOTION_CLASSES: locals()['create_%s_view' % klass.classname()] = \ getattr(views, 'Create%sView' % klass.__name__) locals()['update_%s_view' % klass.classname()] = \ getattr(views, 'Update%sView' % klass.__name__) locals()['delete_%s_view' % klass.classname()] = \ getattr(views, 'Delete%sView' % klass.__name__) def get_urls(self):
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.communications import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Communications')) node.add_child(Node(_('Emails'), 'dashboard:comms-list')) #register(node, 35) class CommsDashboardApplication(Application): name = None list_view = views.ListView update_view = views.UpdateView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='comms-list'), url(r'^(?P<code>\w+)/$', self.update_view.as_view(), name='comms-update'), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name): return staff_member_required application = CommsDashboardApplication()
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.offers import views from oscar.apps.dashboard.nav import register, Node node = Node('Offers', 'dashboard:offer-list') register(node, 50) class OffersDashboardApplication(Application): name = None list_view = views.OfferListView metadata_view = views.OfferMetaDataView condition_view = views.OfferConditionView benefit_view = views.OfferBenefitView preview_view = views.OfferPreviewView delete_view = views.OfferDeleteView detail_view = views.OfferDetailView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.list_view.as_view(), name='offer-list'), # Creation url(r'^metadata/$', self.metadata_view.as_view(), name='offer-metadata'), url(r'^condition/$',
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.users import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Customers')) node.add_child(Node(_('Customers'), 'dashboard:users-index')) node.add_child(Node(_('Alerts'), 'dashboard:user-alert-list')) register(node, 30) class UserManagementApplication(Application): name = None index_view = views.IndexView user_detail_view = views.UserDetailView alert_list_view = views.ProductAlertListView alert_update_view = views.ProductAlertUpdateView alert_delete_view = views.ProductAlertDeleteView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.index_view.as_view(), name='users-index'), # Alerts url(r'^alerts/(?P<pk>\d+)/delete/$', self.alert_delete_view.as_view(), name='user-alert-delete'),
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from accounts.dashboard import views from accounts import names node = Node(_("Accounts")) node.add_child(Node(_(names.UNIT_NAME_PLURAL), 'accounts-list')) node.add_child(Node(_('Transfers'), 'transfers-list')) register(node, 100) class AccountsDashboardApplication(Application): name = None account_list_view = views.AccountListView account_create_view = views.AccountCreateView account_update_view = views.AccountUpdateView account_transactions_view = views.AccountTransactionsView account_freeze_view = views.AccountFreezeView account_thaw_view = views.AccountThawView account_top_up_view = views.AccountTopUpView transfer_list_view = views.TransferListView transfer_detail_view = views.TransferDetailView def get_urls(self):
from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.views.decorators import staff_member_required from stores.dashboard import views node = Node(_('Store Manager')) node.add_child(Node(_('Stores'), 'stores-dashboard:store-list')) node.add_child(Node(_('Store Groups'), 'stores-dashboard:store-group-list')) register(node, 100) class StoresDashboardApplication(Application): name = 'stores-dashboard' store_list_view = views.StoreListView store_create_view = views.StoreCreateView store_update_view = views.StoreUpdateView store_delete_view = views.StoreDeleteView store_group_list_view = views.StoreGroupListView store_group_create_view = views.StoreGroupCreateView store_group_update_view = views.StoreGroupUpdateView store_group_delete_view = views.StoreGroupDeleteView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.store_list_view.as_view(), name='store-list'), url(r'^create/$',
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from . import views try: from oscar.apps.dashboard.nav import register, Node except ImportError: pass else: # Old way of registering Dashboard nodes node = Node('Sagepay', 'sagepay-transaction-list') register(node, 100) class SagepayDashboard(Application): name = None list_view = views.Transactions detail_view = views.Transaction def get_urls(self): urlpatterns = patterns( '', url(r'^transactions/$', self.list_view.as_view(), name='sagepay-transaction-list'), url(r'^transactions/(?P<pk>\d+)/$', self.detail_view.as_view(), name='sagepay-transaction-detail'), )
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.ranges import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Ranges'), 'dashboard:range-list') register(node, 70) class RangeDashboardApplication(Application): name = None list_view = views.RangeListView create_view = views.RangeCreateView update_view = views.RangeUpdateView delete_view = views.RangeDeleteView products_view = views.RangeProductListView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.list_view.as_view(), name='range-list'), url(r'^create/$', self.create_view.as_view(), name='range-create'), url(r'^(?P<pk>\d+)/$', self.update_view.as_view(), name='range-update'), url(r'^(?P<pk>\d+)/delete/$', self.delete_view.as_view(),
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.ranges import views from oscar.apps.dashboard.nav import register, Node node = Node('Ranges', 'dashboard:range-list') register(node, 70) class RangeDashboardApplication(Application): name = None list_view = views.RangeListView create_view = views.RangeCreateView update_view = views.RangeUpdateView delete_view = views.RangeDeleteView products_view = views.RangeProductListView def get_urls(self): urlpatterns = patterns( '', url(r'^$', self.list_view.as_view(), name='range-list'), url(r'^create/$', self.create_view.as_view(), name='range-create'), url(r'^(?P<pk>\d+)/$', self.update_view.as_view(), name='range-update'), url(r'^(?P<pk>\d+)/delete/$', self.delete_view.as_view(), name='range-delete'),
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from accounts.dashboard import views from accounts import names node = Node(_("Accounts")) node.add_child(Node(_(names.UNIT_NAME_PLURAL), 'accounts-list')) node.add_child(Node(_('Transfers'), 'transfers-list')) node.add_child(Node(_('Deferred income report'), 'report-deferred-income')) node.add_child(Node(_('Profile/loss report'), 'report-profit-loss')) register(node, 100) class AccountsDashboardApplication(Application): name = None account_list_view = views.AccountListView account_create_view = views.AccountCreateView account_update_view = views.AccountUpdateView account_transactions_view = views.AccountTransactionsView account_freeze_view = views.AccountFreezeView account_thaw_view = views.AccountThawView account_top_up_view = views.AccountTopUpView transfer_list_view = views.TransferListView transfer_detail_view = views.TransferDetailView
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.ranges import views from oscar.apps.dashboard.nav import register, Node node = Node('Ranges') node.add_child(Node('All ranges', 'dashboard:range-list')) register(node, 70) class RangeDashboardApplication(Application): name = None list_view = views.RangeListView create_view = views.RangeCreateView update_view = views.RangeUpdateView delete_view = views.RangeDeleteView products_view = views.RangeProductListView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='range-list'), url(r'^create/$', self.create_view.as_view(), name='range-create'), url(r'^(?P<pk>\d+)/$', self.update_view.as_view(), name='range-update'), url(r'^(?P<pk>\d+)/delete/$', self.delete_view.as_view(), name='range-delete'), url(r'^(?P<pk>\d+)/products/$', self.products_view.as_view(), name='range-products'), ) return self.post_process_urls(urlpatterns)
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.apps.dashboard.reviews import views node = Node(_('Reviews'), 'dashboard:reviews-list') register(node, 35) class ReviewsApplication(Application): name = None list_view = views.ReviewListView update_view = views.ReviewUpdateView delete_view = views.ReviewDeleteView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='reviews-list'), url(r'^(?P<pk>\d+)/$', self.update_view.as_view(), name='reviews-update' ), url(r'^(?P<pk>\d+)/delete/$', self.delete_view.as_view(), name='reviews-delete' ), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name):
from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.views.decorators import staff_member_required from stores.dashboard import views node = Node(_('Store Manager')) node.add_child(Node(_('Stores'), 'stores-dashboard:store-list')) node.add_child(Node(_('Store Groups'), 'stores-dashboard:store-group-list')) register(node, 100) class StoresDashboardApplication(Application): name = 'stores-dashboard' store_list_view = views.StoreListView store_create_view = views.StoreCreateView store_update_view = views.StoreUpdateView store_delete_view = views.StoreDeleteView store_group_list_view = views.StoreGroupListView store_group_create_view = views.StoreGroupCreateView store_group_update_view = views.StoreGroupUpdateView store_group_delete_view = views.StoreGroupDeleteView def get_urls(self): urlpatterns = patterns('', url( r'^$',
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.catalogue import views from oscar.apps.dashboard.nav import register, Node node = Node('Catalogue') node.add_child(Node('Products', 'dashboard:catalogue-product-list')) node.add_child(Node('Categories', 'dashboard:catalogue-category-list')) node.add_child(Node('Stock alerts', 'dashboard:stock-alert-list')) register(node, 10) class CatalogueApplication(Application): name = None product_list_view = views.ProductListView product_create_redirect_view = views.ProductCreateRedirectView product_create_view = views.ProductCreateView product_update_view = views.ProductUpdateView category_list_view = views.CategoryListView category_detail_list_view = views.CategoryDetailListView category_create_view = views.CategoryCreateView category_update_view = views.CategoryUpdateView category_delete_view = views.CategoryDeleteView stock_alert_view = views.StockAlertListView def get_urls(self):
from django.conf.urls.defaults import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.orders import views from oscar.apps.dashboard.nav import register, Node node = Node('Orders') node.add_child(Node('Orders', 'dashboard:order-list')) node.add_child(Node('Statistics', 'dashboard:order-stats')) register(node, 80) class OrdersDashboardApplication(Application): name = None order_list_view = views.OrderListView order_detail_view = views.OrderDetailView shipping_address_view = views.ShippingAddressUpdateView line_detail_view = views.LineDetailView order_stats_view = views.OrderStatsView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.order_list_view.as_view(), name='order-list'), url(r'^statistics/$', self.order_stats_view.as_view(), name='order-stats'), url(r'^(?P<number>[-\w]+)/$', self.order_detail_view.as_view(), name='order-detail'), url(r'^(?P<number>[-\w]+)/notes/(?P<note_id>\d+)/$', self.order_detail_view.as_view(), name='order-detail-note'), url(r'^(?P<number>[-\w]+)/lines/(?P<line_id>\d+)/$', self.line_detail_view.as_view(), name='order-line-detail'),
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from django.utils.translation import ugettext_lazy as _ from oscar.core.application import Application from oscar.apps.dashboard.promotions import views from oscar.apps.promotions.conf import PROMOTION_CLASSES from oscar.apps.dashboard.nav import register, Node node = Node(_('Content')) node.add_child(Node(_('Re-usable content blocks'), 'dashboard:promotion-list')) node.add_child(Node(_('Content blocks by page'), 'dashboard:promotion-list-by-page')) node.add_child(Node(_('Pages'), 'dashboard:page-list')) register(node, 20) class PromotionsDashboardApplication(Application): name = None list_view = views.ListView page_list = views.PageListView page_detail = views.PageDetailView create_redirect_view = views.CreateRedirectView delete_page_promotion_view = views.DeletePagePromotionView for klass in PROMOTION_CLASSES: locals()['create_%s_view' % klass.classname()] = \ getattr(views, 'Create%sView' % klass.__name__) locals()['update_%s_view' % klass.classname()] = \ getattr(views, 'Update%sView' % klass.__name__) locals()['delete_%s_view' % klass.classname()] = \ getattr(views, 'Delete%sView' % klass.__name__)
from django.utils.translation import ugettext_lazy as _ from django.conf.urls.defaults import patterns, url, include from oscar.core.application import Application from oscar.apps.dashboard.nav import register, Node from oscar.views.decorators import staff_member_required from fancypages.dashboard import views from fancypages.assets.app import application as assets_app node = Node(_("Page Manager")) node.add_child(Node(_("Pages"), "fp-dashboard:page-list")) node.add_child(Node(_("Page Types"), "fp-dashboard:page-type-list")) node.add_child(Node(_("Page Templates"), "fp-dashboard:page-template-list")) register(node, 100) class FancypagesDashboardApplication(Application): name = "fp-dashboard" assets_app = assets_app page_template_list_view = views.PageTemplateListView page_template_create_view = views.PageTemplateCreateView page_template_update_view = views.PageTemplateUpdateView page_template_delete_view = views.PageTemplateDeleteView page_type_list_view = views.PageTypeListView page_type_create_view = views.PageTypeCreateView page_type_update_view = views.PageTypeUpdateView page_type_delete_view = views.PageTypeDeleteView
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from oscar.apps.dashboard.communications import views from oscar.apps.dashboard.nav import register, Node node = Node(_('Communications')) node.add_child(Node(_('Emails'), 'dashboard:comms-list')) register(node, 35) class CommsDashboardApplication(Application): name = None list_view = views.ListView update_view = views.UpdateView def get_urls(self): urlpatterns = patterns('', url(r'^$', self.list_view.as_view(), name='comms-list'), url(r'^(?P<code>\w+)/$', self.update_view.as_view(), name='comms-update'), ) return self.post_process_urls(urlpatterns) def get_url_decorator(self, url_name): return staff_member_required application = CommsDashboardApplication()