当前位置: 首页>>代码示例>>Python>>正文


Python permissions.get_default_model_permissions函数代码示例

本文整理汇总了Python中shuup.admin.utils.permissions.get_default_model_permissions函数的典型用法代码示例。如果您正苦于以下问题:Python get_default_model_permissions函数的具体用法?Python get_default_model_permissions怎么用?Python get_default_model_permissions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_default_model_permissions函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^products/(?P<pk>\d+)/delete/$", "shuup.admin.modules.products.views.ProductDeleteView",
             name="product.delete",
             permissions=["shuup.delete_product"]
         ),
         admin_url(
             "^products/(?P<pk>\d+)/media/$", "shuup.admin.modules.products.views.ProductMediaEditView",
             name="product.edit_media",
             permissions=get_default_model_permissions(Product),
         ),
         admin_url(
             "^products/(?P<pk>\d+)/crosssell/$", "shuup.admin.modules.products.views.ProductCrossSellEditView",
             name="product.edit_cross_sell",
             permissions=get_default_model_permissions(ProductCrossSell),
         ),
         admin_url(
             "^products/(?P<pk>\d+)/variation/$", "shuup.admin.modules.products.views.ProductVariationView",
             name="product.edit_variation",
             permissions=get_default_model_permissions(ProductVariationResult),
         ),
         admin_url(
             "^products/(?P<pk>\d+)/package/$", "shuup.admin.modules.products.views.ProductPackageView",
             name="product.edit_package",
             permissions=get_default_model_permissions(ProductPackageLink)
         )
     ] + get_edit_and_list_urls(
         url_prefix="^products",
         view_template="shuup.admin.modules.products.views.Product%sView",
         name_template="product.%s",
         permissions=get_default_model_permissions(Product)
     )
开发者ID:shawnadelic,项目名称:shuup,代码行数:33,代码来源:__init__.py

示例2: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^addons/$",
             "shuup.addons.admin_module.views.AddonListView",
             name="addon.list",
             permissions=get_default_model_permissions(Shop)
         ),
         admin_url(
             "^addons/add/$",
             "shuup.addons.admin_module.views.AddonUploadView",
             name="addon.upload",
             permissions=get_default_model_permissions(Shop)
         ),
         admin_url(
             "^addons/add/confirm/$",
             "shuup.addons.admin_module.views.AddonUploadConfirmView",
             name="addon.upload_confirm",
             permissions=get_default_model_permissions(Shop)
         ),
         admin_url(
             "^addons/reload/$",
             "shuup.addons.admin_module.views.ReloadView",
             name="addon.reload",
             permissions=get_default_model_permissions(Shop)
         ),
     ]
开发者ID:ahmadzai,项目名称:shuup,代码行数:27,代码来源:__init__.py

示例3: get_required_permissions

 def get_required_permissions(self):
     return (
         get_permissions_from_urls(self.get_urls()) |
         get_default_model_permissions(Contact) |
         get_default_model_permissions(Order) |
         get_default_model_permissions(Product)
     )
开发者ID:hrayr-artunyan,项目名称:shuup,代码行数:7,代码来源:__init__.py

示例4: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^contacts/new/$",
             "shuup.admin.modules.contacts.views.ContactEditView",
             kwargs={"pk": None},
             name="contact.new",
             permissions=["shuup.add_contact"],
         ),
         admin_url(
             "^contacts/(?P<pk>\d+)/edit/$",
             "shuup.admin.modules.contacts.views.ContactEditView",
             name="contact.edit",
             permissions=["shuup.change_contact"],
         ),
         admin_url(
             "^contacts/(?P<pk>\d+)/$",
             "shuup.admin.modules.contacts.views.ContactDetailView",
             name="contact.detail",
             permissions=get_default_model_permissions(Contact),
         ),
         admin_url(
             "^contacts/reset-password/(?P<pk>\d+)/$",
             "shuup.admin.modules.contacts.views.ContactResetPasswordView",
             name="contact.reset_password",
             permissions=get_default_model_permissions(Contact),
         ),
         admin_url(
             "^contacts/$",
             "shuup.admin.modules.contacts.views.ContactListView",
             name="contact.list",
             permissions=get_default_model_permissions(Contact),
         ),
     ]
开发者ID:NamiStudio,项目名称:shuup,代码行数:34,代码来源:__init__.py

示例5: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^adjust-stock/(?P<supplier_id>\d+)/(?P<product_id>\d+)/",
             "shuup.simple_supplier.admin_module.views.process_stock_adjustment",
             name="simple_supplier.stocks",
             permissions=get_default_model_permissions(StockAdjustment)
         ),
         admin_url(
             "^alert-limit/(?P<supplier_id>\d+)/(?P<product_id>\d+)/",
             "shuup.simple_supplier.admin_module.views.process_alert_limit",
             name="simple_supplier.alert_limits",
             permissions=get_default_model_permissions(StockAdjustment)
         ),
         admin_url(
             "^stocks/",
             "shuup.simple_supplier.admin_module.views.StocksListView",
             name="simple_supplier.stocks"
         ),
         admin_url(
             "^list-settings/",
             "shuup.admin.modules.settings.views.ListSettingsView",
             name="simple_supplier.list_settings",
             permissions=get_default_model_permissions(StockAdjustment),
         )
     ]
开发者ID:shawnadelic,项目名称:shuup,代码行数:26,代码来源:__init__.py

示例6: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^shops/(?P<pk>\d+)/enable/$",
             "shuup.admin.modules.shops.views.ShopEnablerView",
             name="shop.enable",
             permissions=get_default_model_permissions(Shop)
         ),
     ] + get_edit_and_list_urls(
         url_prefix="^shops",
         view_template="shuup.admin.modules.shops.views.Shop%sView",
         name_template="shop.%s",
         permissions=get_default_model_permissions(Shop)
     )
开发者ID:gurch101,项目名称:shuup,代码行数:14,代码来源:__init__.py

示例7: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^categories/(?P<pk>\d+)/copy-visibility/$",
             "shuup.admin.modules.categories.views.CategoryCopyVisibilityView",
             name="category.copy_visibility",
             permissions=get_default_model_permissions(Category)
         )
     ] + get_edit_and_list_urls(
         url_prefix="^categories",
         view_template="shuup.admin.modules.categories.views.Category%sView",
         name_template="category.%s",
         permissions=get_default_model_permissions(Category),
     )
开发者ID:andela-kerinoso,项目名称:shuup,代码行数:14,代码来源:__init__.py

示例8: get_urls

 def get_urls(self):
     return get_edit_and_list_urls(
         url_prefix="^carousels",
         view_template="shuup.front.apps.carousel.admin_module.views.Carousel%sView",
         name_template="carousel.%s",
         permissions=get_default_model_permissions(Carousel)
     ) + [
         admin_url(
             "^carousel/(?P<pk>\d+)/delete/$",
             "shuup.front.apps.carousel.admin_module.views.CarouselDeleteView",
             name="carousel.delete",
             permissions=get_default_model_permissions(Carousel)
         ),
     ]
开发者ID:suutari,项目名称:shoop,代码行数:14,代码来源:__init__.py

示例9: get_urls

 def get_urls(self):
     return [
         admin_url(
             "^importer/import$",
             "shuup.importer.admin_module.import_views.ImportView",
             name="importer.import",
             permissions=get_default_model_permissions(Shop)
         ),
         admin_url(
             "^importer/import/process$",
             "shuup.importer.admin_module.import_views.ImportProcessView",
             name="importer.import_process",
             permissions=get_default_model_permissions(Shop)
         ),
     ]
开发者ID:suutari,项目名称:shoop,代码行数:15,代码来源:__init__.py

示例10: get_urls

 def get_urls(self):  # doccov: ignore
     return [
         admin_url(
             "^xtheme/(?P<theme_identifier>.+?)/",
             "shuup.xtheme.admin_module.views.ThemeConfigDetailView",
             name="xtheme.config_detail",
             permissions=get_default_model_permissions(ThemeSettings)
         ),
         admin_url(
             "^xtheme/",
             "shuup.xtheme.admin_module.views.ThemeConfigView",
             name="xtheme.config",
             permissions=get_default_model_permissions(ThemeSettings)
         )
     ]
开发者ID:NamiStudio,项目名称:shuup,代码行数:15,代码来源:__init__.py

示例11: get_urls

 def get_urls(self):
     return get_edit_and_list_urls(
         url_prefix="^categories",
         view_template="shuup.admin.modules.categories.views.Category%sView",
         name_template="category.%s",
         permissions=get_default_model_permissions(Category),
     )
开发者ID:ahmadzai,项目名称:shuup,代码行数:7,代码来源:__init__.py

示例12: get_stock_adjustment_div

def get_stock_adjustment_div(request, supplier, product):
    """
    Get html string to adjust stock values

    Contains inputs for purchase_price_value and delta

    :param request: HTTP request
    :type request: django.http.HttpRequest
    :param supplier: shuup Supplier
    :type supplier: shuup.core.models.Supplier
    :param product: shuup Product
    :type product: shuup.core.models.Product
    :return: html div as a string
    :rtype: str
    """
    latest_adjustment = StockAdjustment.objects.filter(
        product=product, supplier=supplier, type=StockAdjustmentType.INVENTORY
    ).last()
    purchase_price = latest_adjustment.purchase_price_value if latest_adjustment else Decimal("0.00")
    context = {
        "product": product,
        "supplier": supplier,
        "delta_step": pow(0.1, product.sales_unit.decimals),
        "adjustment_form": StockAdjustmentForm(initial={"purchase_price": purchase_price, "delta": None}),
    }
    if "shuup.notify" in settings.INSTALLED_APPS:
        from shuup.notify.models import Notification

        context["alert_limit_form"] = AlertLimitForm(initial={"alert_limit": 0})
        if not get_missing_permissions(request.user, get_default_model_permissions(Notification)):
            context["notify_url"] = reverse("shuup_admin:notify.script.list")
        else:
            context["notify_url"] = ""
    return render_to_string("shuup/simple_supplier/admin/add_stock_form.jinja", context=context, request=request)
开发者ID:shawnadelic,项目名称:shuup,代码行数:34,代码来源:utils.py

示例13: get_urls

 def get_urls(self):
     return get_edit_and_list_urls(
         url_prefix="^cms/page",
         view_template="shuup.simple_cms.admin_module.views.Page%sView",
         name_template="simple_cms.page.%s",
         permissions=get_default_model_permissions(Page)
     )
开发者ID:ahmadzai,项目名称:shuup,代码行数:7,代码来源:__init__.py

示例14: get_urls

 def get_urls(self):
     permissions = get_default_model_permissions(NotificationModel)
     return [
         admin_url(
             "notify/script-item-editor/",
             "shuup.notify.admin_module.views.script_item_editor",
             name="notify.script-item-editor",
             permissions=permissions
         ),
         admin_url(
             "notify/script/content/(?P<pk>\d+)/",
             "shuup.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="shuup.notify.admin_module.views.Script%sView",
         name_template="notify.script.%s",
         permissions=permissions
     )
开发者ID:suutari,项目名称:shoop,代码行数:27,代码来源:__init__.py

示例15: get_urls

 def get_urls(self):
     return get_edit_and_list_urls(
         url_prefix="^default-tax/rules",
         view_template="shuup.default_tax.admin_module.views.TaxRule%sView",
         name_template="default_tax.tax_rule.%s",
         permissions=get_default_model_permissions(TaxRule)
     )
开发者ID:ahmadzai,项目名称:shuup,代码行数:7,代码来源:__init__.py


注:本文中的shuup.admin.utils.permissions.get_default_model_permissions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。