shuup.admin.modules.categories.views package

Submodules

shuup.admin.modules.categories.views.copy module

class shuup.admin.modules.categories.views.copy.CategoryCopyVisibilityView(**kwargs)[source]

Bases: View

Copy category visibility settings to all products with this category as the primary category.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]

shuup.admin.modules.categories.views.delete module

class shuup.admin.modules.categories.views.delete.CategoryDeleteView(**kwargs)[source]

Bases: DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Category

context_object_name = 'category'
get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]

shuup.admin.modules.categories.views.edit module

class shuup.admin.modules.categories.views.edit.CategoryEditView(**kwargs)[source]

Bases: SaveFormPartsMixin, FormPartsViewMixin, CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

model

alias of Category

template_name = 'shuup/admin/categories/edit.jinja'
context_object_name = 'category'
base_form_part_classes: Any | Any = [<class 'shuup.admin.modules.categories.form_parts.CategoryBaseFormPart'>, <class 'shuup.admin.modules.categories.form_parts.CategoryProductFormPart'>]
form_part_class_provide_key: str | None = 'admin_category_form_part'
get_toolbar()[source]
get_context_data(**kwargs)[source]

Insert the form into the context dict.

form_valid(form)[source]

If the form is valid, save the associated model.

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.

shuup.admin.modules.categories.views.list module

class shuup.admin.modules.categories.views.list.CategoryListView[source]

Bases: PicotableListView

model

alias of Category

category_status_choices = [(0, CategoryStatus.INVISIBLE), (1, CategoryStatus.VISIBLE)]
default_columns = [<Column: Image> image, <Column: Name> name, <Column: Status> status, <Column: Visibility> visibility]
toolbar_buttons_provider_key: str | None = 'category_list_toolbar_provider'
mass_actions_provider_key: str | None = 'category_list_mass_actions_provider'
get_name_filter_choices()[source]
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 case QuerySet specific behavior will be enabled.

format_name(instance, *args, **kwargs)[source]
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]

Module contents

class shuup.admin.modules.categories.views.CategoryEditView(**kwargs)[source]

Bases: SaveFormPartsMixin, FormPartsViewMixin, CreateOrUpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

base_form_part_classes: Any | Any = [<class 'shuup.admin.modules.categories.form_parts.CategoryBaseFormPart'>, <class 'shuup.admin.modules.categories.form_parts.CategoryProductFormPart'>]
context_object_name = 'category'
form_part_class_provide_key: str | None = 'admin_category_form_part'
form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

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_toolbar()[source]
model

alias of Category

template_name = 'shuup/admin/categories/edit.jinja'
class shuup.admin.modules.categories.views.CategoryDeleteView(**kwargs)[source]

Bases: DetailView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

context_object_name = 'category'
get(request, *args, **kwargs)[source]
model

alias of Category

post(request, *args, **kwargs)[source]
class shuup.admin.modules.categories.views.CategoryListView[source]

Bases: PicotableListView

category_status_choices = [(0, CategoryStatus.INVISIBLE), (1, CategoryStatus.VISIBLE)]
default_columns = [<Column: Image> image, <Column: Name> name, <Column: Status> status, <Column: Visibility> visibility]
format_name(instance, *args, **kwargs)[source]
get_name_filter_choices()[source]
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 case QuerySet specific behavior will be enabled.

mass_actions_provider_key: str | None = 'category_list_mass_actions_provider'
model

alias of Category

toolbar_buttons_provider_key: str | None = 'category_list_toolbar_provider'
class shuup.admin.modules.categories.views.CategoryCopyVisibilityView(**kwargs)[source]

Bases: View

Copy category visibility settings to all products with this category as the primary category.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

post(request, *args, **kwargs)[source]