本文整理汇总了Python中shoop.admin.utils.urls.admin_url函数的典型用法代码示例。如果您正苦于以下问题:Python admin_url函数的具体用法?Python admin_url怎么用?Python admin_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_urls
def get_urls(self):
return [
admin_url(
"^contacts/new/$",
"shoop.admin.modules.contacts.views.ContactEditView",
kwargs={"pk": None},
name="contact.new",
permissions=["shoop.add_contact"],
),
admin_url(
"^contacts/(?P<pk>\d+)/edit/$",
"shoop.admin.modules.contacts.views.ContactEditView",
name="contact.edit",
permissions=["shoop.change_contact"],
),
admin_url(
"^contacts/(?P<pk>\d+)/$",
"shoop.admin.modules.contacts.views.ContactDetailView",
name="contact.detail",
permissions=get_default_model_permissions(Contact),
),
admin_url(
"^contacts/reset-password/(?P<pk>\d+)/$",
"shoop.admin.modules.contacts.views.ContactResetPasswordView",
name="contact.reset_password",
permissions=get_default_model_permissions(Contact),
),
admin_url(
"^contacts/$",
"shoop.admin.modules.contacts.views.ContactListView",
name="contact.list",
permissions=get_default_model_permissions(Contact),
),
]
示例2: get_urls
def get_urls(self):
permissions = get_default_model_permissions(NotificationModel)
return [
admin_url(
"notify/script-item-editor/",
"shoop.notify.admin_module.views.script_item_editor",
name="notify.script-item-editor",
permissions=permissions
),
admin_url(
"notify/script/content/(?P<pk>\d+)/",
"shoop.notify.admin_module.views.EditScriptContentView",
name="notify.script.edit-content",
permissions=permissions
),
admin_url(
"notify/mark-read/(?P<pk>\d+)/$",
self.mark_notification_read_view,
name="notify.mark-read",
permissions=permissions
),
] + get_edit_and_list_urls(
url_prefix="^notify/script",
view_template="shoop.notify.admin_module.views.Script%sView",
name_template="notify.script.%s",
permissions=permissions
)
示例3: _get_per_method_type_urls
def _get_per_method_type_urls(self, url_part, class_name_prefix, url_name_prefix):
ns = {
"url_part": url_part,
"class_name_prefix": class_name_prefix,
"url_name_prefix": url_name_prefix,
}
return [
admin_url(
"^methods/%(url_part)s/(?P<pk>\d+)/detail/$" % ns,
"shoop.admin.modules.methods.views.%(class_name_prefix)sEditDetailView" % ns,
name="%(url_name_prefix)s.edit-detail" % ns
),
admin_url(
"^methods/%(url_part)s/(?P<pk>\d+)/$" % ns,
"shoop.admin.modules.methods.views.%(class_name_prefix)sEditView" % ns,
name="%(url_name_prefix)s.edit" % ns
),
admin_url(
"^methods/%(url_part)s/new/$" % ns,
"shoop.admin.modules.methods.views.%(class_name_prefix)sEditView" % ns,
kwargs={"pk": None},
name="%(url_name_prefix)s.new" % ns
),
admin_url(
"^methods/%(url_part)s/$" % ns,
"shoop.admin.modules.methods.views.%(class_name_prefix)sListView" % ns,
name="%(url_name_prefix)s.list" % ns
),
]
示例4: get_urls
def get_urls(self):
return [
admin_url(
"^addons/$",
"shoop.addons.admin_module.views.AddonListView",
name="addon.list",
permissions=get_default_model_permissions(Shop)
),
admin_url(
"^addons/add/$",
"shoop.addons.admin_module.views.AddonUploadView",
name="addon.upload",
permissions=get_default_model_permissions(Shop)
),
admin_url(
"^addons/add/confirm/$",
"shoop.addons.admin_module.views.AddonUploadConfirmView",
name="addon.upload_confirm",
permissions=get_default_model_permissions(Shop)
),
admin_url(
"^addons/reload/$",
"shoop.addons.admin_module.views.ReloadView",
name="addon.reload",
permissions=get_default_model_permissions(Shop)
),
]
示例5: get_urls
def get_urls(self):
return [
admin_url(
"^contacts/new/$",
"shoop.admin.modules.contacts.views.ContactEditView",
kwargs={"pk": None},
name="contact.new"
),
admin_url(
"^contacts/(?P<pk>\d+)/edit/$",
"shoop.admin.modules.contacts.views.ContactEditView",
name="contact.edit"
),
admin_url(
"^contacts/(?P<pk>\d+)/$",
"shoop.admin.modules.contacts.views.ContactDetailView",
name="contact.detail"
),
admin_url(
"^contacts/reset-password/(?P<pk>\d+)/$",
"shoop.admin.modules.contacts.views.ContactResetPasswordView",
name="contact.reset_password"
),
admin_url(
"^contacts/$",
"shoop.admin.modules.contacts.views.ContactListView",
name="contact.list"
),
]
示例6: get_urls
def get_urls():
urls = []
urls.extend(get_module_urls())
urls.extend([
admin_url(r'^$', DashboardView.as_view(), name='dashboard'),
admin_url(r'^search/$', SearchView.as_view(), name='search'),
admin_url(r'^menu/$', MenuView.as_view(), name='menu'),
admin_url(
r'^login/$',
login,
kwargs={"template_name": "shoop/admin/auth/login.jinja"},
name='login',
require_authentication=False
),
admin_url(
r'^logout/$',
auth_views.logout,
kwargs={"template_name": "shoop/admin/auth/logout.jinja"},
name='logout',
require_authentication=False
),
])
for u in urls: # pragma: no cover
if not isinstance(u, AdminRegexURLPattern):
warnings.warn("Admin URL %r is not an AdminRegexURLPattern" % u)
# Add Django javascript catalog url
urls.append(url(r'^jsi18n.js$', javascript_catalog, {'packages': ('shoop',)}, name='js-catalog'))
return tuple(urls)
示例7: get_urls
def get_urls(self):
return [
admin_url(
"^orders/(?P<pk>\d+)/create-shipment/$",
"shoop.admin.modules.orders.views.OrderCreateShipmentView",
name="order.create-shipment"
),
admin_url(
"^orders/(?P<pk>\d+)/set-status/$",
"shoop.admin.modules.orders.views.OrderSetStatusView",
name="order.set-status"
),
admin_url(
"^orders/(?P<pk>\d+)/$",
"shoop.admin.modules.orders.views.OrderDetailView",
name="order.detail"
),
admin_url(
"^orders/new/$",
"shoop.admin.modules.orders.views.OrderCreateView",
name="order.new"
),
admin_url(
"^orders/$",
"shoop.admin.modules.orders.views.OrderListView",
name="order.list"
),
]
示例8: get_urls
def get_urls(self):
return [
admin_url(
"^products/(?P<pk>\d+)/delete/$", "shoop.admin.modules.products.views.ProductDeleteView",
name="product.delete"
),
admin_url(
"^products/(?P<pk>\d+)/media/$", "shoop.admin.modules.products.views.ProductMediaEditView",
name="product.edit_media"
),
admin_url(
"^products/(?P<pk>\d+)/crosssell/$", "shoop.admin.modules.products.views.ProductCrossSellEditView",
name="product.edit_cross_sell"
),
admin_url(
"^products/(?P<pk>\d+)/variation/$", "shoop.admin.modules.products.views.ProductVariationView",
name="product.edit_variation"
),
admin_url(
"^products/(?P<pk>\d+)/package/$", "shoop.admin.modules.products.views.ProductPackageView",
name="product.edit_package"
),
] + get_edit_and_list_urls(
url_prefix="^products",
view_template="shoop.admin.modules.products.views.Product%sView",
name_template="product.%s"
)
示例9: get_urls
def get_urls(self): # doccov: ignore
return [
admin_url(
"^xtheme/(?P<theme_identifier>.+?)/",
"shoop.xtheme.admin_module.views.ThemeConfigDetailView",
name="xtheme.config_detail",
),
admin_url("^xtheme/", "shoop.xtheme.admin_module.views.ThemeConfigView", name="xtheme.config"),
]
示例10: get_urls
def get_urls(self):
return [
# TODO: Add url for tax dashboard?
# urls for Tax
admin_url(
"^taxes/tax/(?P<pk>\d+)/$",
"shoop.admin.modules.taxes.views.edit.TaxEditView",
name="tax.edit"
),
admin_url(
"^taxes/tax/new/$",
"shoop.admin.modules.taxes.views.edit.TaxEditView",
kwargs={"pk": None},
name="tax.new"
),
admin_url(
"^taxes/tax/$",
"shoop.admin.modules.taxes.views.list.TaxListView",
name="tax.list"
),
# urls for CustomerTaxGroup
admin_url(
"^taxes/customer-tax-group/(?P<pk>\d+)/$",
"shoop.admin.modules.taxes.views.edit.CustomerTaxGroupEditView",
name="customer_tax_group.edit"
),
admin_url(
"^taxes/customer-tax-group/new/$",
"shoop.admin.modules.taxes.views.edit.CustomerTaxGroupEditView",
kwargs={"pk": None},
name="customer_tax_group.new"),
admin_url(
"^taxes/customer-tax-group/$",
"shoop.admin.modules.taxes.views.list.CustomerTaxGroupListView",
name="customer_tax_group.list"
),
# urls for TaxClass
admin_url(
"^taxes/tax-class/(?P<pk>\d+)/$",
"shoop.admin.modules.taxes.views.edit.TaxClassEditView",
name="tax_class.edit"
),
admin_url(
"^taxes/tax-class/new/$",
"shoop.admin.modules.taxes.views.edit.TaxClassEditView",
kwargs={"pk": None},
name="tax_class.new"
),
admin_url(
"^taxes/tax-class/$",
"shoop.admin.modules.taxes.views.list.TaxClassListView",
name="tax_class.list"
),
]
示例11: get_urls
def get_urls(self):
return [
admin_url(
"^adjust-stock/(?P<supplier_id>\d+)/(?P<product_id>\d+)/",
"shoop.simple_supplier.admin_module.views.process_stock_adjustment",
name="simple_supplier.stocks"
),
admin_url(
"^stocks/",
"shoop.simple_supplier.admin_module.views.StocksListView",
name="simple_supplier.stocks"
),
]
示例12: get_urls
def get_urls(self):
return [
admin_url(
"test/$", OkAction,
name="test-auth", require_authentication=True),
admin_url(
"test2/$", "shoop_tests.admin.fixtures.test_module.OkAction",
name="test-unauth", require_authentication=False),
admin_url(
"test3/$", "shoop_tests.admin.fixtures.test_module.OkAction",
name="test-perm", require_authentication=True,
permissions=("bogus-permission",)),
]
示例13: get_urls
def get_urls(self): # doccov: ignore
return [
admin_url(
"^xtheme/(?P<theme_identifier>.+?)/",
"shoop.xtheme.admin_module.views.ThemeConfigDetailView",
name="xtheme.config_detail",
permissions=get_default_model_permissions(ThemeSettings)
),
admin_url(
"^xtheme/",
"shoop.xtheme.admin_module.views.ThemeConfigView",
name="xtheme.config",
permissions=get_default_model_permissions(ThemeSettings)
)
]
示例14: get_urls
def get_urls(self):
return [
admin_url(
"^media/$",
"shoop.admin.modules.media.views.MediaBrowserView",
name="media.browse"
),
]
示例15: get_urls
def get_urls(self):
return [
admin_url(
"^carts/$",
"shoop.front.admin_module.carts.views.CartListView",
name="cart.list",
permissions=get_default_model_permissions(StoredBasket),
),
]