shuup.admin.modules.products.forms package

Submodules

shuup.admin.modules.products.forms.base_forms module

class shuup.admin.modules.products.forms.base_forms.ProductBaseForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of Product

fields = ('accounting_identifier', 'barcode', 'cost_center', 'depth', 'gross_weight', 'gtin', 'height', 'manufacturer', 'net_weight', 'profit_center', 'sales_unit', 'shipping_mode', 'sku', 'tax_class', 'type', 'width', 'description', 'short_description', 'keywords', 'name', 'slug', 'variation_name')
widgets = {'description': <shuup.admin.forms.widgets.TextEditorWidget object>, 'keywords': <django.forms.widgets.TextInput object>, 'sales_unit': <shuup.admin.forms.widgets.QuickAddSalesUnitSelect object>, 'short_description': <django.forms.widgets.TextInput object>, 'tax_class': <shuup.admin.forms.widgets.QuickAddTaxClassSelect object>}
__init__(**kwargs)[source]
save(**kwargs)[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.

clean()[source]

Avoid partially translated languages where the translated fields that are required are not set.

base_fields = {'accounting_identifier': <django.forms.fields.CharField object>, 'barcode': <django.forms.fields.CharField object>, 'cost_center': <django.forms.fields.CharField object>, 'depth': <shuup.core.fields.FormattedDecimalFormField object>, 'description': <django.forms.fields.CharField object>, 'file': <django.forms.fields.CharField object>, 'gross_weight': <shuup.core.fields.FormattedDecimalFormField object>, 'gtin': <django.forms.fields.CharField object>, 'height': <shuup.core.fields.FormattedDecimalFormField object>, 'keywords': <django.forms.fields.CharField object>, 'manufacturer': <django.forms.models.ModelChoiceField object>, 'name': <django.forms.fields.CharField object>, 'net_weight': <shuup.core.fields.FormattedDecimalFormField object>, 'profit_center': <django.forms.fields.CharField object>, 'sales_unit': <django.forms.models.ModelChoiceField object>, 'shipping_mode': <enumfields.forms.EnumChoiceField object>, 'short_description': <django.forms.fields.CharField object>, 'sku': <django.forms.fields.CharField object>, 'slug': <django.forms.fields.SlugField object>, 'tax_class': <django.forms.models.ModelChoiceField object>, 'type': <django.forms.models.ModelChoiceField object>, 'variation_name': <django.forms.fields.CharField object>, 'width': <shuup.core.fields.FormattedDecimalFormField object>}
declared_fields = {'description': <django.forms.fields.CharField object>, 'file': <django.forms.fields.CharField object>, 'keywords': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'short_description': <django.forms.fields.CharField object>, 'slug': <django.forms.fields.SlugField object>, 'variation_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class shuup.admin.modules.products.forms.base_forms.ShopProductForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of ShopProduct

fields = ('default_price_value', 'minimum_price_value', 'suppliers', 'available_until', 'visibility', 'purchasable', 'visibility_limit', 'visibility_groups', 'purchase_multiple', 'minimum_purchase_quantity', 'backorder_maximum', 'display_unit', 'limit_shipping_methods', 'limit_payment_methods', 'shipping_methods', 'payment_methods', 'primary_category', 'categories', 'status_text')
help_texts = {'backorder_maximum': 'Number of units that can be purchased after the product is out of stock. Set to blank for product to be purchasable without limits.'}
widgets = {'display_unit': <shuup.admin.forms.widgets.QuickAddDisplayUnitSelect object>, 'payment_methods': <shuup.admin.forms.widgets.QuickAddPaymentMethodsSelect object>, 'shipping_methods': <shuup.admin.forms.widgets.QuickAddShippingMethodsSelect object>}
__init__(**kwargs)[source]
clean()[source]

Avoid partially translated languages where the translated fields that are required are not set.

base_fields = {'available_until': <django.forms.fields.DateTimeField object>, 'backorder_maximum': <shuup.core.fields.FormattedDecimalFormField object>, 'categories': <django.forms.models.ModelMultipleChoiceField object>, 'default_price_value': <shuup.core.fields.FormattedDecimalFormField object>, 'display_unit': <django.forms.models.ModelChoiceField object>, 'limit_payment_methods': <django.forms.fields.BooleanField object>, 'limit_shipping_methods': <django.forms.fields.BooleanField object>, 'minimum_price_value': <shuup.core.fields.FormattedDecimalFormField object>, 'minimum_purchase_quantity': <shuup.core.fields.FormattedDecimalFormField object>, 'payment_methods': <django.forms.models.ModelMultipleChoiceField object>, 'primary_category': <django.forms.models.ModelChoiceField object>, 'purchasable': <django.forms.fields.BooleanField object>, 'purchase_multiple': <shuup.core.fields.FormattedDecimalFormField object>, 'shipping_methods': <django.forms.models.ModelMultipleChoiceField object>, 'status_text': <django.forms.fields.CharField object>, 'suppliers': <django.forms.models.ModelMultipleChoiceField object>, 'visibility': <enumfields.forms.EnumChoiceField object>, 'visibility_groups': <django.forms.models.ModelMultipleChoiceField object>, 'visibility_limit': <enumfields.forms.EnumChoiceField object>}
declared_fields = {'status_text': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class shuup.admin.modules.products.forms.base_forms.ProductAttributesForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
save()[source]
base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class shuup.admin.modules.products.forms.base_forms.BaseProductMediaForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of ProductMedia

fields = ('file', 'ordering', 'external_url', 'public', 'title', 'description', 'purchased', 'kind')
__init__(**kwargs)[source]
filter_allowed_kinds(allowed_kinds_values)[source]
get_thumbnail(request)[source]

Get thumbnail url.

If thumbnail creation fails for whatever reason, an error message is displayed for user.

pre_master_save(instance)[source]
base_fields = {'description': <django.forms.fields.CharField 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>, '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.forms.base_forms.BaseProductMediaFormSet(*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 = 0
allowed_media_kinds = []
form_class

alias of BaseProductMediaForm

__init__(*args, **kwargs)[source]
get_queryset()[source]
form(**kwargs)[source]
save(commit=True)[source]

Save model instances for every form, adding and changing instances as necessary, and return the list of instances.

property empty_form
property can_delete_extra
class shuup.admin.modules.products.forms.base_forms.ProductMediaForm(**kwargs)[source]

Bases: BaseProductMediaForm

__init__(**kwargs)[source]
clean_external_url()[source]
base_fields = {'description': <django.forms.fields.CharField 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>, '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.forms.base_forms.ProductMediaFormSet(*args, **kwargs)[source]

Bases: BaseProductMediaFormSet

form_class

alias of ProductMediaForm

allowed_media_kinds = [ProductMediaKind.GENERIC_FILE, ProductMediaKind.DOCUMENTATION, ProductMediaKind.SAMPLE]
class shuup.admin.modules.products.forms.base_forms.ProductImageMediaForm(**kwargs)[source]

Bases: BaseProductMediaForm

__init__(**kwargs)[source]
clean_file()[source]
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 = {'description': <django.forms.fields.CharField object>, 'external_url': <django.forms.fields.URLField object>, 'file': <filer.fields.file.AdminFileFormField object>, 'is_primary': <django.forms.fields.BooleanField object>, 'kind': <enumfields.forms.EnumChoiceField object>, 'ordering': <django.forms.fields.IntegerField object>, 'public': <django.forms.fields.BooleanField object>, 'purchased': <django.forms.fields.BooleanField object>, 'title': <django.forms.fields.CharField object>}
declared_fields = {'description': <django.forms.fields.CharField object>, 'is_primary': <django.forms.fields.BooleanField 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.forms.base_forms.ProductImageMediaFormSet(*args, **kwargs)[source]

Bases: ProductMediaFormSet

allowed_media_kinds = [ProductMediaKind.IMAGE]
form_class

alias of ProductImageMediaForm

save(commit=True)[source]

Save the form.

In addition add the first saved image as primary image for the product if none is selected as such.

shuup.admin.modules.products.forms.package_forms module

class shuup.admin.modules.products.forms.package_forms.PackageChildForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
get_shop_products(user)[source]
get_stock_statuses(user=None)[source]
get_orderability_errors(user=None)[source]
base_fields = {'child': <django.forms.models.ModelChoiceField object>, 'quantity': <django.forms.fields.DecimalField object>}
declared_fields = {'child': <django.forms.models.ModelChoiceField object>, 'quantity': <django.forms.fields.DecimalField object>}
property media

Return all media required to render the widgets on this form.

shuup.admin.modules.products.forms.package_forms.get_stock_statuses(product, shop_products)[source]
shuup.admin.modules.products.forms.package_forms.get_orderability_errors(product, shop_products)[source]
class shuup.admin.modules.products.forms.package_forms.PackageChildFormSet(**kwargs)[source]

Bases: ProductChildBaseFormSet

deletion_label = ''
__init__(**kwargs)[source]
save()[source]
get_selected_and_removed()[source]

shuup.admin.modules.products.forms.parent_forms module

class shuup.admin.modules.products.forms.parent_forms.ProductChildBaseFormSet(**kwargs)[source]

Bases: BaseFormSet

deletion_label = None
__init__(**kwargs)[source]

Module contents

class shuup.admin.modules.products.forms.BaseProductMediaForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

fields = ('file', 'ordering', 'external_url', 'public', 'title', 'description', 'purchased', 'kind')
model

alias of ProductMedia

__init__(**kwargs)[source]
base_fields = {'description': <django.forms.fields.CharField 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>, 'title': <django.forms.fields.CharField object>}
declared_fields = {'description': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}
filter_allowed_kinds(allowed_kinds_values)[source]
get_thumbnail(request)[source]

Get thumbnail url.

If thumbnail creation fails for whatever reason, an error message is displayed for user.

property media

Return all media required to render the widgets on this form.

pre_master_save(instance)[source]
class shuup.admin.modules.products.forms.PackageChildForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
base_fields = {'child': <django.forms.models.ModelChoiceField object>, 'quantity': <django.forms.fields.DecimalField object>}
declared_fields = {'child': <django.forms.models.ModelChoiceField object>, 'quantity': <django.forms.fields.DecimalField object>}
get_orderability_errors(user=None)[source]
get_shop_products(user)[source]
get_stock_statuses(user=None)[source]
property media

Return all media required to render the widgets on this form.

class shuup.admin.modules.products.forms.PackageChildFormSet(**kwargs)[source]

Bases: ProductChildBaseFormSet

__init__(**kwargs)[source]
deletion_label = ''
get_selected_and_removed()[source]
save()[source]
class shuup.admin.modules.products.forms.ProductAttributesForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

save()[source]
class shuup.admin.modules.products.forms.ProductBaseForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

fields = ('accounting_identifier', 'barcode', 'cost_center', 'depth', 'gross_weight', 'gtin', 'height', 'manufacturer', 'net_weight', 'profit_center', 'sales_unit', 'shipping_mode', 'sku', 'tax_class', 'type', 'width', 'description', 'short_description', 'keywords', 'name', 'slug', 'variation_name')
model

alias of Product

widgets = {'description': <shuup.admin.forms.widgets.TextEditorWidget object>, 'keywords': <django.forms.widgets.TextInput object>, 'sales_unit': <shuup.admin.forms.widgets.QuickAddSalesUnitSelect object>, 'short_description': <django.forms.widgets.TextInput object>, 'tax_class': <shuup.admin.forms.widgets.QuickAddTaxClassSelect object>}
__init__(**kwargs)[source]
base_fields = {'accounting_identifier': <django.forms.fields.CharField object>, 'barcode': <django.forms.fields.CharField object>, 'cost_center': <django.forms.fields.CharField object>, 'depth': <shuup.core.fields.FormattedDecimalFormField object>, 'description': <django.forms.fields.CharField object>, 'file': <django.forms.fields.CharField object>, 'gross_weight': <shuup.core.fields.FormattedDecimalFormField object>, 'gtin': <django.forms.fields.CharField object>, 'height': <shuup.core.fields.FormattedDecimalFormField object>, 'keywords': <django.forms.fields.CharField object>, 'manufacturer': <django.forms.models.ModelChoiceField object>, 'name': <django.forms.fields.CharField object>, 'net_weight': <shuup.core.fields.FormattedDecimalFormField object>, 'profit_center': <django.forms.fields.CharField object>, 'sales_unit': <django.forms.models.ModelChoiceField object>, 'shipping_mode': <enumfields.forms.EnumChoiceField object>, 'short_description': <django.forms.fields.CharField object>, 'sku': <django.forms.fields.CharField object>, 'slug': <django.forms.fields.SlugField object>, 'tax_class': <django.forms.models.ModelChoiceField object>, 'type': <django.forms.models.ModelChoiceField object>, 'variation_name': <django.forms.fields.CharField object>, 'width': <shuup.core.fields.FormattedDecimalFormField object>}
clean()[source]

Avoid partially translated languages where the translated fields that are required are not set.

declared_fields = {'description': <django.forms.fields.CharField object>, 'file': <django.forms.fields.CharField object>, 'keywords': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'short_description': <django.forms.fields.CharField object>, 'slug': <django.forms.fields.SlugField object>, 'variation_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

save(**kwargs)[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.

class shuup.admin.modules.products.forms.ProductImageMediaForm(**kwargs)[source]

Bases: BaseProductMediaForm

__init__(**kwargs)[source]
base_fields = {'description': <django.forms.fields.CharField object>, 'external_url': <django.forms.fields.URLField object>, 'file': <filer.fields.file.AdminFileFormField object>, 'is_primary': <django.forms.fields.BooleanField object>, 'kind': <enumfields.forms.EnumChoiceField object>, 'ordering': <django.forms.fields.IntegerField object>, 'public': <django.forms.fields.BooleanField object>, 'purchased': <django.forms.fields.BooleanField object>, 'title': <django.forms.fields.CharField object>}
clean_file()[source]
declared_fields = {'description': <django.forms.fields.CharField object>, 'is_primary': <django.forms.fields.BooleanField object>, 'title': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

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.

class shuup.admin.modules.products.forms.ProductImageMediaFormSet(*args, **kwargs)[source]

Bases: ProductMediaFormSet

allowed_media_kinds = [ProductMediaKind.IMAGE]
form_class

alias of ProductImageMediaForm

save(commit=True)[source]

Save the form.

In addition add the first saved image as primary image for the product if none is selected as such.

class shuup.admin.modules.products.forms.ProductMediaForm(**kwargs)[source]

Bases: BaseProductMediaForm

__init__(**kwargs)[source]
base_fields = {'description': <django.forms.fields.CharField 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>, 'title': <django.forms.fields.CharField object>}
clean_external_url()[source]
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.forms.ProductMediaFormSet(*args, **kwargs)[source]

Bases: BaseProductMediaFormSet

allowed_media_kinds = [ProductMediaKind.GENERIC_FILE, ProductMediaKind.DOCUMENTATION, ProductMediaKind.SAMPLE]
form_class

alias of ProductMediaForm

class shuup.admin.modules.products.forms.ShopProductForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

fields = ('default_price_value', 'minimum_price_value', 'suppliers', 'available_until', 'visibility', 'purchasable', 'visibility_limit', 'visibility_groups', 'purchase_multiple', 'minimum_purchase_quantity', 'backorder_maximum', 'display_unit', 'limit_shipping_methods', 'limit_payment_methods', 'shipping_methods', 'payment_methods', 'primary_category', 'categories', 'status_text')
help_texts = {'backorder_maximum': 'Number of units that can be purchased after the product is out of stock. Set to blank for product to be purchasable without limits.'}
model

alias of ShopProduct

widgets = {'display_unit': <shuup.admin.forms.widgets.QuickAddDisplayUnitSelect object>, 'payment_methods': <shuup.admin.forms.widgets.QuickAddPaymentMethodsSelect object>, 'shipping_methods': <shuup.admin.forms.widgets.QuickAddShippingMethodsSelect object>}
__init__(**kwargs)[source]
base_fields = {'available_until': <django.forms.fields.DateTimeField object>, 'backorder_maximum': <shuup.core.fields.FormattedDecimalFormField object>, 'categories': <django.forms.models.ModelMultipleChoiceField object>, 'default_price_value': <shuup.core.fields.FormattedDecimalFormField object>, 'display_unit': <django.forms.models.ModelChoiceField object>, 'limit_payment_methods': <django.forms.fields.BooleanField object>, 'limit_shipping_methods': <django.forms.fields.BooleanField object>, 'minimum_price_value': <shuup.core.fields.FormattedDecimalFormField object>, 'minimum_purchase_quantity': <shuup.core.fields.FormattedDecimalFormField object>, 'payment_methods': <django.forms.models.ModelMultipleChoiceField object>, 'primary_category': <django.forms.models.ModelChoiceField object>, 'purchasable': <django.forms.fields.BooleanField object>, 'purchase_multiple': <shuup.core.fields.FormattedDecimalFormField object>, 'shipping_methods': <django.forms.models.ModelMultipleChoiceField object>, 'status_text': <django.forms.fields.CharField object>, 'suppliers': <django.forms.models.ModelMultipleChoiceField object>, 'visibility': <enumfields.forms.EnumChoiceField object>, 'visibility_groups': <django.forms.models.ModelMultipleChoiceField object>, 'visibility_limit': <enumfields.forms.EnumChoiceField object>}
clean()[source]

Avoid partially translated languages where the translated fields that are required are not set.

declared_fields = {'status_text': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.