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
- 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.
- 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.
- 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.
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
- 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
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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'
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
- 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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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 calladd_error
to add errors to form or modify theform.cleaned_data
dictionary.- Parameters:
form (ProductListForm) – Form that is currently cleaned
- Return type:
None
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:
request – Current request
category (shuup.core.models.Category|None) – Current category
- 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)]
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]
- property media