shuup.admin.modules.products.views package
Submodules
shuup.admin.modules.products.views.copy module
- class shuup.admin.modules.products.views.copy.ProductCopyView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- model
alias of
ShopProduct
- context_object_name = 'product'
- product_listing_names = ['products']
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- get_success_url(copied_shop_product: ShopProduct)[source]
shuup.admin.modules.products.views.delete module
- class shuup.admin.modules.products.views.delete.ProductDeleteView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- model
alias of
ShopProduct
- context_object_name = 'product'
- product_listing_names = ['products']
shuup.admin.modules.products.views.edit module
- class shuup.admin.modules.products.views.edit.ProductBaseFormPart(request, object=None)[source]
Bases:
FormPart
- class shuup.admin.modules.products.views.edit.ShopProductFormPart(request, **kwargs)[source]
Bases:
FormPart
- class shuup.admin.modules.products.views.edit.ProductAttributeFormPart(request, object=None)[source]
Bases:
FormPart
- class shuup.admin.modules.products.views.edit.BaseProductMediaFormPart(request, object=None)[source]
Bases:
FormPart
- class shuup.admin.modules.products.views.edit.ProductMediaFormPart(request, object=None)[source]
Bases:
BaseProductMediaFormPart
- name = 'media'
- formset
alias of
ProductMediaFormSet
- class shuup.admin.modules.products.views.edit.ProductImageMediaFormPart(request, object=None)[source]
Bases:
BaseProductMediaFormPart
- name = 'images'
- formset
alias of
ProductImageMediaFormSet
- class shuup.admin.modules.products.views.edit.ProductEditView(**kwargs)[source]
Bases:
SaveFormPartsMixin
,FormPartsViewMixin
,CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- model
alias of
ShopProduct
- context_object_name = 'product'
- template_name = 'shuup/admin/products/edit.jinja'
- base_form_part_classes: Any | Any = []
- add_form_errors_as_messages = True
- product_listing_names = ['products']
- get_object(queryset=None)[source]
Return the object the view is displaying.
Require
self.queryset
and apk
orslug
argument in the URLconf. Subclasses can override this to return any object.
shuup.admin.modules.products.views.edit_cross_sell module
- class shuup.admin.modules.products.views.edit_cross_sell.ProductCrossSellForm(**kwargs)[source]
Bases:
ModelForm
- class Meta[source]
Bases:
object
- model
alias of
ProductCrossSell
- fields = ('product2', 'weight', 'type')
- save(commit=True)[source]
Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.
- base_fields = {'product2': <django.forms.models.ModelChoiceField object>, 'type': <enumfields.forms.EnumChoiceField object>, 'weight': <django.forms.fields.IntegerField object>}
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.products.views.edit_cross_sell.ProductCrossSellFormSet(*args, **kwargs)[source]
Bases:
BaseModelFormSet
- validate_min = False
- min_num = 0
- validate_max = False
- max_num = 1000
- absolute_max = 1000
- model
alias of
ProductCrossSell
- can_delete = True
- can_order = False
- extra = 5
- class shuup.admin.modules.products.views.edit_cross_sell.ProductCrossSellEditView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/admin/products/edit_cross_sell.jinja'
- context_object_name = 'product'
- form_class
alias of
ProductCrossSellFormSet
shuup.admin.modules.products.views.edit_media module
- class shuup.admin.modules.products.views.edit_media.ProductMediaForm(**kwargs)[source]
Bases:
MultiLanguageModelForm
- class Meta[source]
Bases:
object
- model
alias of
ProductMedia
- fields = ('shops', 'kind', 'file', 'external_url', 'ordering', 'enabled', 'public', 'purchased', 'title', 'description')
- base_fields = {'description': <django.forms.fields.CharField object>, 'enabled': <django.forms.fields.BooleanField object>, 'external_url': <django.forms.fields.URLField object>, 'file': <filer.fields.file.AdminFileFormField object>, 'kind': <enumfields.forms.EnumChoiceField object>, 'ordering': <django.forms.fields.IntegerField object>, 'public': <django.forms.fields.BooleanField object>, 'purchased': <django.forms.fields.BooleanField object>, 'shops': <django.forms.models.ModelMultipleChoiceField object>, 'title': <django.forms.fields.CharField object>}
- declared_fields = {'description': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.products.views.edit_media.ProductMediaFormSet(*args, **kwargs)[source]
Bases:
BaseModelFormSet
- validate_min = False
- min_num = 0
- validate_max = False
- max_num = 1000
- absolute_max = 1000
- model
alias of
ProductMedia
- can_delete = True
- can_order = False
- extra = 5
- class shuup.admin.modules.products.views.edit_media.ProductMediaEditView(**kwargs)[source]
Bases:
UpdateView
A view for editing all the media for a product, including attachments that are not just images.
Currently sort of utilitarian and confusing.
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/admin/products/edit_media.jinja'
- context_object_name = 'product'
- form_class
alias of
ProductMediaForm
shuup.admin.modules.products.views.edit_package module
- class shuup.admin.modules.products.views.edit_package.ProductChildrenFormPart(request, object=None)[source]
Bases:
ProductChildrenBaseFormPart
- invalid_modes = [ProductMode.VARIATION_CHILD, ProductMode.VARIABLE_VARIATION_PARENT, ProductMode.SIMPLE_VARIATION_PARENT]
- class shuup.admin.modules.products.views.edit_package.ProductPackageViewToolbar(view)[source]
Bases:
ProductParentBaseToolbar
- button_text = 'Clear package'
- confirm_text = 'Are you sure? This will remove all products from the package.'
- class shuup.admin.modules.products.views.edit_package.ProductPackageView(**kwargs)[source]
Bases:
ProductParentBaseView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/admin/products/package/edit.jinja'
- form_part_classes = [<class 'shuup.admin.modules.products.views.edit_package.ProductChildrenFormPart'>]
- toolbar_class
alias of
ProductPackageViewToolbar
shuup.admin.modules.products.views.edit_parent module
- class shuup.admin.modules.products.views.edit_parent.ProductChildrenBaseFormPart(request, object=None)[source]
Bases:
FormPart
- invalid_modes = []
- form_name = None
- class shuup.admin.modules.products.views.edit_parent.ProductParentBaseToolbar(view)[source]
Bases:
Toolbar
- class shuup.admin.modules.products.views.edit_parent.ProductParentBaseView(**kwargs)[source]
Bases:
FormPartsViewMixin
,UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- context_object_name = 'product'
- form_class
alias of
Form
- form_part_classes = []
- toolbar_class = None
shuup.admin.modules.products.views.list module
- class shuup.admin.modules.products.views.list.ProductPicotable(request, columns, mass_actions, queryset, context)[source]
Bases:
Picotable
- class shuup.admin.modules.products.views.list.ProductListView[source]
Bases:
PicotableListView
- model
alias of
ShopProduct
- picotable_class
alias of
ProductPicotable
- product_listing_names = ['products']
- default_columns = [<Column: Primary Image> primary_image, <Column: Name> product_name, <Column: SKU> product_sku, <Column: Barcode> product_barcode, <Column: Mode> product_mode, <Column: Primary Category> primary_category, <Column: Categories> categories]
- mass_actions = ['shuup.admin.modules.products.mass_actions:VisibleMassAction', 'shuup.admin.modules.products.mass_actions:InvisibleMassAction', 'shuup.admin.modules.products.mass_actions:ExportProductsCSVAction', 'shuup.admin.modules.products.mass_actions:EditProductAttributesAction']
- get_queryset()[source]
Return the list of items for this view.
The return value must be an iterable and may be an instance of
QuerySet
in which caseQuerySet
specific behavior will be enabled.
- get_object_abstract(instance, item)[source]
Get the object abstract lines (used for mobile layouts) for this object.
Supported keys in abstract line dicts are:
text (required)
title
class (CSS class name –
header
for instance)raw (boolean; whether or not the
text
is raw HTML)
- Parameters:
instance – The instance.
item – The item dict so far. Useful for reusing precalculated values.
- Returns:
Iterable of dicts to pass through to the picotable javascript.
- Return type:
Iterable[dict]
shuup.admin.modules.products.views.mass_edit module
- class shuup.admin.modules.products.views.mass_edit.MassEditForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]
Bases:
Form
- base_fields = {'categories': <django.forms.models.ModelMultipleChoiceField object>, 'default_price_value': <django.forms.fields.DecimalField object>, 'name': <django.forms.fields.CharField object>, 'primary_category': <django.forms.models.ModelChoiceField object>, 'purchasable': <django.forms.fields.BooleanField object>, 'visibility': <enumfields.forms.EnumChoiceField object>}
- declared_fields = {'categories': <django.forms.models.ModelMultipleChoiceField object>, 'default_price_value': <django.forms.fields.DecimalField object>, 'name': <django.forms.fields.CharField object>, 'primary_category': <django.forms.models.ModelChoiceField object>, 'purchasable': <django.forms.fields.BooleanField object>, 'visibility': <enumfields.forms.EnumChoiceField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.admin.modules.products.views.mass_edit.ProductMassEditView(**kwargs)[source]
Bases:
MassEditMixin
,FormView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- title = 'Mass Edit: Products'
- form_class
alias of
MassEditForm
shuup.admin.modules.products.views.toolbars module
Module contents
- class shuup.admin.modules.products.views.ProductCrossSellEditView(**kwargs)[source]
Bases:
UpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- context_object_name = 'product'
- form_class
alias of
ProductCrossSellFormSet
- template_name = 'shuup/admin/products/edit_cross_sell.jinja'
- class shuup.admin.modules.products.views.ProductDeleteView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- context_object_name = 'product'
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model
alias of
ShopProduct
- product_listing_names = ['products']
- class shuup.admin.modules.products.views.ProductEditView(**kwargs)[source]
Bases:
SaveFormPartsMixin
,FormPartsViewMixin
,CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- add_form_errors_as_messages = True
- base_form_part_classes: Any | Any = []
- context_object_name = 'product'
- get_object(queryset=None)[source]
Return the object the view is displaying.
Require
self.queryset
and apk
orslug
argument in the URLconf. Subclasses can override this to return any object.
- get_queryset()[source]
Return the
QuerySet
that will be used to look up the object.This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model
alias of
ShopProduct
- product_listing_names = ['products']
- template_name = 'shuup/admin/products/edit.jinja'
- class shuup.admin.modules.products.views.ProductListView[source]
Bases:
PicotableListView
- default_columns = [<Column: Primary Image> primary_image, <Column: Name> product_name, <Column: SKU> product_sku, <Column: Barcode> product_barcode, <Column: Mode> product_mode, <Column: Primary Category> primary_category, <Column: Categories> categories]
- get_object_abstract(instance, item)[source]
Get the object abstract lines (used for mobile layouts) for this object.
Supported keys in abstract line dicts are:
text (required)
title
class (CSS class name –
header
for instance)raw (boolean; whether or not the
text
is raw HTML)
- Parameters:
instance – The instance.
item – The item dict so far. Useful for reusing precalculated values.
- Returns:
Iterable of dicts to pass through to the picotable javascript.
- Return type:
Iterable[dict]
- get_queryset()[source]
Return the list of items for this view.
The return value must be an iterable and may be an instance of
QuerySet
in which caseQuerySet
specific behavior will be enabled.
- mass_actions = ['shuup.admin.modules.products.mass_actions:VisibleMassAction', 'shuup.admin.modules.products.mass_actions:InvisibleMassAction', 'shuup.admin.modules.products.mass_actions:ExportProductsCSVAction', 'shuup.admin.modules.products.mass_actions:EditProductAttributesAction']
- model
alias of
ShopProduct
- picotable_class
alias of
ProductPicotable
- product_listing_names = ['products']
- class shuup.admin.modules.products.views.ProductPackageView(**kwargs)[source]
Bases:
ProductParentBaseView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_part_classes = [<class 'shuup.admin.modules.products.views.edit_package.ProductChildrenFormPart'>]
- template_name = 'shuup/admin/products/package/edit.jinja'
- toolbar_class
alias of
ProductPackageViewToolbar
- class shuup.admin.modules.products.views.ProductMediaEditView(**kwargs)[source]
Bases:
UpdateView
A view for editing all the media for a product, including attachments that are not just images.
Currently sort of utilitarian and confusing.
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- context_object_name = 'product'
- form_class
alias of
ProductMediaForm
- get_object(queryset=None)[source]
Return the object the view is displaying.
Require
self.queryset
and apk
orslug
argument in the URLconf. Subclasses can override this to return any object.
- template_name = 'shuup/admin/products/edit_media.jinja'
- class shuup.admin.modules.products.views.ProductMassEditView(**kwargs)[source]
Bases:
MassEditMixin
,FormView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class
alias of
MassEditForm
- title = 'Mass Edit: Products'