shuup.front.forms package

Submodules

shuup.front.forms.order_forms module

class shuup.front.forms.order_forms.ProductOrderForm(request, context, product, language, **kwargs)[source]

Bases: FormView

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

template_name = 'shuup/front/product/forms/product_order_form.jinja'
engine = None
priority = 0
__init__(request, context, product, language, **kwargs)[source]

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

render()[source]
is_compatible()[source]
class shuup.front.forms.order_forms.VariableVariationProductOrderForm(request, context, product, language, **kwargs)[source]

Bases: ProductOrderForm

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

is_compatible()[source]
class shuup.front.forms.order_forms.SimpleVariationProductOrderForm(request, context, product, language, **kwargs)[source]

Bases: ProductOrderForm

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

is_compatible()[source]
class shuup.front.forms.order_forms.SimpleProductOrderForm(request, context, product, language, **kwargs)[source]

Bases: ProductOrderForm

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

is_compatible()[source]

shuup.front.forms.product_list_modifiers module

class shuup.front.forms.product_list_modifiers.FilterWidget(attrs=None, choices=())[source]

Bases: SelectMultiple

render(name, value, attrs=None, choices=(), renderer=None)[source]

Render the widget as an HTML string.

property media
class shuup.front.forms.product_list_modifiers.OneChoiceFilterWidget(attrs=None, choices=())[source]

Bases: Select

render(name, value, attrs=None, choices=(), renderer=None)[source]

Render the widget as an HTML string.

property media
class shuup.front.forms.product_list_modifiers.CommaSeparatedListField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

Bases: CharField

to_python(value)[source]

Return a string.

prepare_value(value)[source]
class shuup.front.forms.product_list_modifiers.SimpleProductListModifier[source]

Bases: ProductListFormModifier

is_active_key = ''
is_active_label = ''
ordering_key = ''
ordering_label = ''
should_use(configuration)[source]
Parameters:

configuration (dict) – current configurations

Returns:

Boolean whether the modifier should be used based

on current configurations. :rtype: boolean

get_ordering(configuration)[source]
Parameters:

configuration (dict) – current configurations

Returns:

Ordering value based on configurations

Return type:

int

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.SortProductListByName[source]

Bases: SimpleProductListModifier

is_active_key = 'sort_products_by_name'
is_active_label = 'Sort products by name'
ordering_key = 'sort_products_by_name_ordering'
ordering_label = 'Ordering for sort by name'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_choices_for_fields()[source]

Provide sort choices for product list form

Returns:

List of sort choices that should be added for form

sort field. Tuple should contain sort key and label name. :rtype: list[(str,str)]

sort_products_queryset(request, queryset, data)[source]

Sort the products queryset Modify current queryset and return the new one.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.SortProductListByPrice[source]

Bases: SimpleProductListModifier

is_active_key = 'sort_products_by_price'
is_active_label = 'Sort products by price'
ordering_key = 'sort_products_by_price_ordering'
ordering_label = 'Ordering for sort by price'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_choices_for_fields()[source]

Provide sort choices for product list form

Returns:

List of sort choices that should be added for form

sort field. Tuple should contain sort key and label name. :rtype: list[(str,str)]

sort_products_queryset(request, queryset, data)[source]

Sort the products queryset Modify current queryset and return the new one.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.SortProductListByCreatedDate[source]

Bases: SimpleProductListModifier

is_active_key = 'sort_products_by_date_created'
is_active_label = 'Sort products by date created'
ordering_key = 'sort_products_by_date_created_ordering'
ordering_label = 'Ordering for sort by date created'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_choices_for_fields()[source]

Provide sort choices for product list form

Returns:

List of sort choices that should be added for form

sort field. Tuple should contain sort key and label name. :rtype: list[(str,str)]

sort_products_queryset(request, queryset, data)[source]

Sort the products queryset Modify current queryset and return the new one.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.SortProductListByAscendingCreatedDate[source]

Bases: SortProductListByCreatedDate

is_active_key = 'sort_products_by_ascending_created_date'
is_active_label = 'Sort products by date created - oldest first'
ordering_key = 'sort_products_by_ascending_created_date_ordering'
ordering_label = 'Ordering for sort by date created - oldest first'
get_choices_for_fields()[source]

Provide sort choices for product list form

Returns:

List of sort choices that should be added for form

sort field. Tuple should contain sort key and label name. :rtype: list[(str,str)]

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.ManufacturerProductListFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_manufacturer'
is_active_label = 'Filter products by manufacturer'
ordering_key = 'filter_products_by_manufacturer_ordering'
ordering_label = 'Ordering for filter by manufacturer'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_filters(request, data)[source]

Get filters based for the product list view

Add Django query filters for Product queryset based on current request and ProductListForm data.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.CategoryProductListFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_category'
is_active_label = 'Filter products by category'
ordering_key = 'filter_products_by_category_ordering'
ordering_label = 'Ordering for filter by category'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_filters(request, data)[source]

Get filters based for the product list view

Add Django query filters for Product queryset based on current request and ProductListForm data.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.LimitProductListPageSize[source]

Bases: SimpleProductListModifier

is_active_key = 'limit_product_list_page_size'
is_active_label = 'Limit page size'
ordering_key = 'limit_product_list_page_size_ordering'
ordering_label = 'Ordering for limit page size'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_choices_for_fields()[source]

Provide sort choices for product list form

Returns:

List of sort choices that should be added for form

sort field. Tuple should contain sort key and label name. :rtype: list[(str,str)]

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.ProductVariationFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_variation_value'
is_active_label = 'Filter products by variation'
ordering_key = 'filter_products_by_variation_value_ordering'
ordering_label = 'Ordering for filter by variation'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_products_queryset(request, queryset, data)[source]

Modify product queryset

Modify current queryset and return the new one. This can be used when there is need for stacking multiple filters for one queryset.

Returns:

Updated product queryset

Return type:

Product.queryset

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.ProductPriceFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_price'
is_active_label = 'Filter products by price'
ordering_key = 'filter_products_by_price_ordering'
ordering_label = 'Ordering for filter by price'
range_min_key = 'filter_products_by_price_range_min'
range_max_key = 'filter_products_by_price_range_max'
range_size_key = 'filter_products_by_price_range_size'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_products_queryset(request, queryset, data)[source]

Modify product queryset

Modify current queryset and return the new one. This can be used when there is need for stacking multiple filters for one queryset.

Returns:

Updated product queryset

Return type:

Product.queryset

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

class shuup.front.forms.product_list_modifiers.AttributeProductListFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_products_attribute'
is_active_label = 'Filter products by its attributes'
ordering_key = 'filter_products_by_attribute_ordering'
product_attr_key = 'filter_products_by_product_attribute_field'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_products_queryset(request, queryset, data)[source]

Modify product queryset

Modify current queryset and return the new one. This can be used when there is need for stacking multiple filters for one queryset.

Returns:

Updated product queryset

Return type:

Product.queryset

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

clean_hook(form)[source]

Extra clean for product list form.

This hook will be called in clean method of the form, after calling parent clean. Implementor of this hook may call add_error to add errors to form or modify the form.cleaned_data dictionary.

Parameters:

form (ProductListForm) – Form that is currently cleaned

Return type:

None

shuup.front.forms.product_list_modifiers.get_price_ranges(shop, min_price, max_price, range_step)[source]

shuup.front.forms.product_list_supplier_modifier module

class shuup.front.forms.product_list_supplier_modifier.SupplierProductListFilter[source]

Bases: SimpleProductListModifier

is_active_key = 'filter_products_by_supplier'
is_active_label = 'Filter products by supplier'
ordering_key = 'filter_products_by_supplier_ordering'
ordering_label = 'Ordering for filter by supplier'
label_key = 'filter_products_by_supplier_label'
enable_multiselect_key = 'filter_products_by_supplier_multiselect_enabled'
get_fields(request, category=None)[source]

Extra fields for product list form.

Parameters:
Returns:

List of extra fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

get_filters(request, data)[source]

Get filters based for the product list view

Add Django query filters for Product queryset based on current request and ProductListForm data.

get_admin_fields()[source]

Admin fields for sorts and filters configurations

Adds fields for sorts and filters admin configuration form.

Returns:

List of fields that should be added to form.

Tuple should contain field name and Django form field. :rtype: list[(str,django.forms.Field)]

shuup.front.forms.widget module

class shuup.front.forms.widget.PictureDnDUploaderWidget(attrs=None, kind='images', upload_path='/contacts', clearable=False, browsable=True, upload_url=None, dropzone_attrs=None)[source]

Bases: Widget

__init__(attrs=None, kind='images', upload_path='/contacts', clearable=False, browsable=True, upload_url=None, dropzone_attrs=None)[source]
render(name, value, attrs=None, renderer=None)[source]

Render the widget as an HTML string.

property media

Module contents