shuup.xtheme.plugins package¶
Submodules¶
shuup.xtheme.plugins.category_links module¶
-
class
shuup.xtheme.plugins.category_links.
CategoryLinksConfigForm
(**kwargs)[source]¶ Bases:
shuup.xtheme.plugins.forms.GenericPluginForm
A configuration form for the CategoryLinksPlugin
-
clean
()[source]¶ A custom clean method to save category configuration information in a serializable form
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
-
class
shuup.xtheme.plugins.category_links.
CategoryLinksPlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
A plugin for displaying links to visible categories on the shop front
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'category_links'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/xtheme/plugins/category_links.jinja'¶
-
editor_form_class
¶ alias of
CategoryLinksConfigForm
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc62f7908>), ('show_all_categories', <django.forms.fields.BooleanField object at 0x7fabc62f3518>), 'categories']¶
-
shuup.xtheme.plugins.consts module¶
-
shuup.xtheme.plugins.consts.
FALLBACK_LANGUAGE_CODE
= '*'¶ The pseudo-language code used by TranslatedFields and the relevant Plugin API to mark the untranslated/fallback content
shuup.xtheme.plugins.forms module¶
-
class
shuup.xtheme.plugins.forms.
PluginForm
(**kwargs)[source]¶ Bases:
django.forms.forms.Form
Base class for plugin configuration forms.
-
set_defaults
()[source]¶ Set the forms initial values based on plugin defaults
Use the plugin’s default configuration as the default form field initial values.
-
get_config
()[source]¶ Get the new
config
dict for a plugin.Called when the form is valid, akin to
django.forms.models.ModelForm.save
.The default implementation just augments the old config with the cleaned data for the form.
Returns: A new JSONable (!) config dict Return type: dict
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
shuup.xtheme.plugins.image module¶
-
class
shuup.xtheme.plugins.image.
ImagePluginChoiceWidget
(attrs=None, clearable=False, empty_text='—')[source]¶ Bases:
shuup.admin.forms.widgets.ImageChoiceWidget
Subclass of ImageChoiceWidget that will not raise an exception if given an invalid initial image ID (in case the image has been deleted)
-
media
¶
-
-
class
shuup.xtheme.plugins.image.
ImageIDField
(max_value=None, min_value=None, *args, **kwargs)[source]¶ Bases:
django.forms.fields.IntegerField
A custom field that stores the ID value of a Filer image and presents Shuup admin’s image popup widget
-
widget
= <shuup.xtheme.plugins.image.ImagePluginChoiceWidget object>¶
-
-
class
shuup.xtheme.plugins.image.
ImagePlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
A linkable image plugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'images'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/xtheme/plugins/image.jinja'¶
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc7bb5080>), ('image_id', <shuup.xtheme.plugins.image.ImageIDField object at 0x7fabc7bb5b70>), ('url', <django.forms.fields.URLField object at 0x7fabc7bb5a58>), ('full_width', <django.forms.fields.BooleanField object at 0x7fabc7bb5518>), ('width', <django.forms.fields.IntegerField object at 0x7fabc6212ac8>), ('height', <django.forms.fields.IntegerField object at 0x7fabc63fa3c8>)]¶
-
shuup.xtheme.plugins.products module¶
-
class
shuup.xtheme.plugins.products.
ProductHighlightPlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'product_highlight'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/xtheme/plugins/highlight_plugin.jinja'¶
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc63faa58>), ('type', <django.forms.fields.ChoiceField object at 0x7fabc6e6a710>), ('count', <django.forms.fields.IntegerField object at 0x7fabc6e6a898>), ('orderable_only', <django.forms.fields.BooleanField object at 0x7fabc6e6a630>)]¶
-
-
class
shuup.xtheme.plugins.products.
ProductCrossSellsPlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
-
identifier
= 'product_cross_sells'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/xtheme/plugins/cross_sells_plugin.jinja'¶
-
required_context_variables
= ['product']¶
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc6e6a4a8>), ('type', <enumfields.forms.EnumChoiceField object at 0x7fabc6e6a978>), ('count', <django.forms.fields.IntegerField object at 0x7fabc63e9438>), ('orderable_only', <django.forms.fields.BooleanField object at 0x7fabc6e6a908>)]¶
-
-
class
shuup.xtheme.plugins.products.
ProductsFromCategoryForm
(**kwargs)[source]¶ Bases:
shuup.xtheme.plugins.forms.GenericPluginForm
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
-
class
shuup.xtheme.plugins.products.
ProductsFromCategoryPlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'category_products'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/xtheme/plugins/highlight_plugin.jinja'¶
-
editor_form_class
¶ alias of
ProductsFromCategoryForm
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc63e2be0>), ('count', <django.forms.fields.IntegerField object at 0x7fabc6d95080>), 'category']¶
-
shuup.xtheme.plugins.snippets module¶
-
class
shuup.xtheme.plugins.snippets.
SnippetsPlugin
(config)[source]¶ Bases:
shuup.xtheme.Plugin
Simple plugin class for including snippets and resources on the page, mostly for simple integrations.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'snippets'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
fields
= [('in_place', <django.forms.fields.CharField object at 0x7fabcd522da0>), ('head_end', <django.forms.fields.CharField object at 0x7fabcd522160>), ('body_start', <django.forms.fields.CharField object at 0x7fabcd625eb8>), ('body_end', <django.forms.fields.CharField object at 0x7fabcd522a90>)]¶
-
shuup.xtheme.plugins.social_media_links module¶
Bases:
shuup.xtheme.plugins.forms.GenericPluginForm
Form for the social media links xtheme plugin. One field is provided for each entry in the plugin’s icon_classes attribute, which maps social media site names to font-awesome icon classes by default.
Populates form with default plugin fields as well as any social media link type included in the plugin’s
icon_classes
attribute.Also adds an ordering field for each link type to change display order.
Returns cleaned data from default plugin fields and any link fields.
Processed link configuration information is stored and returned as a dictionary (
links
).
Bases:
shuup.xtheme.TemplatedPlugin
An xtheme plugin for displaying site links to common social media sites.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data alias of
SocialMediaLinksPluginForm
Returns plugin settings and a sorted list of social media links
Returns: Plugin context data Return type: dict
Returns the list of social media links sorted according to ordering
Returns: List of link tuples (ordering, icon class, url) Return type: [(int, str, str)]
shuup.xtheme.plugins.text module¶
-
class
shuup.xtheme.plugins.text.
TextPlugin
(config)[source]¶ Bases:
shuup.xtheme.Plugin
Very basic Markdown rendering plugin.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'text'¶
-
name
= 'Text'¶
-
fields
= [('text', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc695dc18>)]¶
-
shuup.xtheme.plugins.widgets module¶
-
class
shuup.xtheme.plugins.widgets.
XThemeModelChoiceWidget
(attrs=None, choices=())[source]¶ Bases:
django.forms.widgets.Select
-
media
¶
-
-
class
shuup.xtheme.plugins.widgets.
XThemeModelChoiceField
(queryset, empty_label='---------', cache_choices=None, required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, *args, **kwargs)[source]¶ Bases:
django.forms.models.ModelChoiceField
-
widget
¶ alias of
XThemeModelChoiceWidget
-