本文整理汇总了Python中shoop.admin.toolbar.get_default_edit_toolbar函数的典型用法代码示例。如果您正苦于以下问题:Python get_default_edit_toolbar函数的具体用法?Python get_default_edit_toolbar怎么用?Python get_default_edit_toolbar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_default_edit_toolbar函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, view):
super(ProductVariationViewToolbar, self).__init__()
self.view = view
self.parent_product = view.object
self.request = view.request
get_default_edit_toolbar(self.view, "product_form", with_split_save=False, toolbar=self)
if self.parent_product.variation_children.exists():
self.append(PostActionButton(
post_url=self.request.path,
name="command",
value="unvariate",
confirm=_("Are you sure? This will unlink all children and remove all variation variables."),
text=_("Clear variation"),
extra_css_class="btn-danger",
icon="fa fa-times"
))
if (
self.parent_product.mode == ProductMode.VARIABLE_VARIATION_PARENT or
ProductVariationVariable.objects.filter(product=self.parent_product).exists()
):
self.append(PostActionButton(
post_url=self.request.path,
name="command",
value="simplify",
confirm=_("Are you sure? This will remove all variation variables, "
"converting children to direct links."),
text=_("Convert to simple variation"),
icon="fa fa-exchange",
extra_css_class="btn-info"
))
开发者ID:taedori81,项目名称:shoop,代码行数:31,代码来源:edit_variation.py
示例2: __init__
def __init__(self, view_object):
super(Toolbar, self).__init__()
self.view_object = view_object
get_default_edit_toolbar(toolbar=self, view_object=view_object, save_form_id="method_form")
method = view_object.object
if method.pk:
self.build_detail_button(method)
开发者ID:kloudsio,项目名称:shoop,代码行数:7,代码来源:edit.py
示例3: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(
self,
self.get_save_form_id(),
discard_url=(get_model_url(self.object) if self.object.pk else None)
)
# TODO: Add extensibility
return toolbar
开发者ID:00WhengWheng,项目名称:shuup,代码行数:8,代码来源:edit.py
示例4: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(
self,
"change_password_form",
discard_url=get_model_url(self.object),
with_split_save=False
)
return toolbar
开发者ID:Carolina061,项目名称:shoop,代码行数:8,代码来源:password.py
示例5: __init__
def __init__(self, view):
self.view = view
self.request = view.request
self.user = view.object
super(UserDetailToolbar, self).__init__()
self.extend(get_default_edit_toolbar(self.view, "user_form", with_split_save=False))
if self.user.pk:
self._build_existing_user()
开发者ID:monokrome,项目名称:shuup,代码行数:8,代码来源:detail.py
示例6: __init__
def __init__(self, view):
super(EditProductToolbar, self).__init__()
self.view = view
self.request = view.request
self.product = view.object
self.extend(get_default_edit_toolbar(
self.view, "product_form",
delete_url="shoop_admin:product.delete"
))
if self.product.pk:
self._build_existing_product()
开发者ID:portlyjent,项目名称:shoop,代码行数:11,代码来源:toolbars.py
示例7: get_toolbar
def get_toolbar(self):
product = self.object
toolbar = get_default_edit_toolbar(self, "product_form", delete_url="shoop_admin:product.delete")
if product.pk:
toolbar.append(
URLActionButton(
text=_("Manage Product Media"),
icon="fa fa-picture-o",
url=reverse("shoop_admin:product.edit_media", kwargs={"pk": product.pk}),
extra_css_class="btn-info",
)
)
# TODO: Add extensibility
return toolbar
开发者ID:kloudsio,项目名称:shoop,代码行数:16,代码来源:edit.py
示例8: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = reverse_lazy("shoop_admin:service_provider.delete", kwargs={"pk": object.pk})
toolbar = get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
if self.object.pk:
toolbar.append(URLActionButton(
text=_("Create {service_name}").format(
service_name=self.object.service_model._meta.verbose_name),
icon="fa fa-plus",
url="{model_url}?provider={id}".format(
model_url=get_model_url(self.object.service_model, "new"),
id=self.object.id),
extra_css_class="btn-info"
))
return toolbar
开发者ID:00WhengWheng,项目名称:shuup,代码行数:17,代码来源:_edit.py
示例9: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
return get_default_edit_toolbar(self, save_form_id, with_split_save=settings.SHOOP_ENABLE_MULTIPLE_SHOPS)
开发者ID:Carolina061,项目名称:shoop,代码行数:3,代码来源:edit.py
示例10: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
if save_form_id:
return get_default_edit_toolbar(self, save_form_id)
开发者ID:DemOneEh,项目名称:shoop,代码行数:4,代码来源:views.py
示例11: __init__
def __init__(self, view):
super(ProductParentBaseToolbar, self).__init__()
self.view = view
self.parent_product = view.object
self.request = view.request
get_default_edit_toolbar(self.view, "product_form", with_split_save=False, toolbar=self)
开发者ID:JSin,项目名称:shuup,代码行数:6,代码来源:edit_parent.py
示例12: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = get_model_url(object, "delete") if object.pk else None
return get_default_edit_toolbar(self, save_form_id, delete_url=(delete_url if object.can_delete() else None))
开发者ID:00WhengWheng,项目名称:shuup,代码行数:5,代码来源:_edit.py
示例13: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = reverse_lazy("shoop_admin:contact-group.delete", kwargs={"pk": object.pk})
return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url if object.can_delete() else None)
开发者ID:00WhengWheng,项目名称:shuup,代码行数:5,代码来源:edit.py
示例14: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
if save_form_id:
return get_default_edit_toolbar(self, save_form_id, delete_url="shoop_admin:carousel.delete")
开发者ID:suutari-ai,项目名称:shoop-carousel,代码行数:4,代码来源:edit.py
注:本文中的shoop.admin.toolbar.get_default_edit_toolbar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论