shoop.xtheme.plugins package

Submodules

shoop.xtheme.plugins.consts module

shoop.xtheme.plugins.consts.FALLBACK_LANGUAGE_CODE = '*'

The pseudo-language code used by TranslatedFields and the relevant Plugin API to mark the untranslated/fallback content

shoop.xtheme.plugins.forms module

class shoop.xtheme.plugins.forms.PluginForm(**kwargs)[source]

Bases: django.forms.forms.Form

Base class for plugin configuration forms.

populate()[source]
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
class shoop.xtheme.plugins.forms.GenericPluginForm(**kwargs)[source]

Bases: shoop.xtheme.plugins.forms.PluginForm

A generic form for Xtheme plugins; populates itself based on fields in the plugin class.

populate()[source]
base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class shoop.xtheme.plugins.forms.TranslatableField(*args, **kwargs)[source]

Bases: django.forms.fields.Field

widget

alias of TranslatableFieldWidget

clean(value)[source]

shoop.xtheme.plugins.text module

class shoop.xtheme.plugins.text.TextPlugin(config)[source]

Bases: shoop.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', <shoop.xtheme.plugins.forms.TranslatableField object at 0x7f15c0c6ff60>)]
render(context)[source]

shoop.xtheme.plugins.widgets module

class shoop.xtheme.plugins.widgets.TranslatableFieldWidget(languages, input_widget=<class 'django.forms.widgets.TextInput'>, attrs=None)[source]

Bases: django.forms.widgets.Widget

render(name, value, attrs=None)[source]
id_for_label(id_)[source]
value_from_datadict(data, files, name)[source]
format_output(widget_pairs)[source]
decompress(value)[source]
media

Module contents