本文整理汇总了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"
))
示例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)
示例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
示例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
示例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()
示例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()
示例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
示例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
示例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)
示例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)
示例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)
示例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))
示例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)
示例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")