shuup.xtheme.admin_module.views package

Module contents

class shuup.xtheme.admin_module.views.ActivationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: Form

A very simple form for activating a theme.

base_fields = {'activate': <django.forms.fields.CharField object>, 'selected_style': <django.forms.fields.CharField object>}
declared_fields = {'activate': <django.forms.fields.CharField object>, 'selected_style': <django.forms.fields.CharField object>}
property media

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

class shuup.xtheme.admin_module.views.FontEditView(**kwargs)[source]

Bases: CreateOrUpdateView

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

context_object_name = 'font'
form_class

alias of FontForm

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_queryset()[source]

Return the QuerySet that will be used to look up the object.

This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.

model

alias of Font

template_name = 'shuup/xtheme/admin/font_create.jinja'
class shuup.xtheme.admin_module.views.AdminThemeForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = '__all__'
labels = {'danger_color': 'Choose the danger (red) style primary color:', 'primary_color': 'Choose the primary color:', 'secondary_color': 'Choose the secondary color:', 'success_color': 'Choose the success (green) style primary color:', 'text_color': 'Choose the primary text color:'}
model

alias of AdminThemeSettings

widgets = {'danger_color': <django.forms.widgets.TextInput object>, 'primary_color': <django.forms.widgets.TextInput object>, 'secondary_color': <django.forms.widgets.TextInput object>, 'success_color': <django.forms.widgets.TextInput object>, 'text_color': <django.forms.widgets.TextInput object>}
__init__(*args, **kwargs)[source]
base_fields = {'active': <django.forms.fields.BooleanField object>, 'admin_body_font': <django.forms.models.ModelChoiceField object>, 'admin_header_font': <django.forms.models.ModelChoiceField object>, 'base_font_size': <django.forms.fields.CharField object>, 'danger_color': <django.forms.fields.CharField object>, 'primary_color': <django.forms.fields.CharField object>, 'secondary_color': <django.forms.fields.CharField object>, 'shop': <django.forms.models.ModelChoiceField object>, 'success_color': <django.forms.fields.CharField object>, 'text_color': <django.forms.fields.CharField object>}
declared_fields = {}
property media

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

class shuup.xtheme.admin_module.views.AdminThemeConfigDetailView(**kwargs)[source]

Bases: FormView

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

form_class

alias of AdminThemeForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

template_name = 'shuup/xtheme/admin/admin_config_detail.jinja'
class shuup.xtheme.admin_module.views.FontForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = '__all__'
model

alias of Font

__init__(*args, **kwargs)[source]
base_fields = {'css_value': <django.forms.fields.CharField object>, 'eot': <filer.fields.file.AdminFileFormField object>, 'name': <django.forms.fields.CharField object>, 'shop': <django.forms.models.ModelChoiceField object>, 'svg': <filer.fields.file.AdminFileFormField object>, 'ttf': <filer.fields.file.AdminFileFormField object>, 'woff': <filer.fields.file.AdminFileFormField object>, 'woff2': <filer.fields.file.AdminFileFormField object>}
declared_fields = {}
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.xtheme.admin_module.views.FontListView[source]

Bases: PicotableListView

default_columns = [<Column: Name> name, <Column: Woff> woff, <Column: Woff2> woff2, <Column: TTF> ttf, <Column: SVG> svg, <Column: EOT> eot]
format_eot(instance)[source]
format_svg(instance)[source]
format_ttf(instance)[source]
format_woff(instance)[source]
format_woff2(instance)[source]
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of Font

url_identifier = 'xtheme.font'
class shuup.xtheme.admin_module.views.SnippetDeleteView(**kwargs)[source]

Bases: BaseDeleteView

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

delete(request, *args, **kwargs)[source]

Call the delete() method on the fetched object and then redirect to the success URL.

get(request, *args, **kwargs)[source]
get_queryset()[source]

Return the QuerySet that will be used to look up the object.

This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.

model

alias of Snippet

success_url = '/sa/xtheme/snippet/'
class shuup.xtheme.admin_module.views.SnippetEditView(**kwargs)[source]

Bases: CreateOrUpdateView

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

context_object_name = 'snippet'
form_class

alias of SnippetForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_queryset()[source]

Return the QuerySet that will be used to look up the object.

This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.

get_toolbar()[source]
model

alias of Snippet

template_name = 'shuup/xtheme/admin/snippet_edit.jinja'
class shuup.xtheme.admin_module.views.SnippetListView[source]

Bases: PicotableListView

default_columns = [<Column: Name> name, <Column: Location> location, <Column: Type> snippet_type, <Column: Themes> themes]
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_themes(value)[source]
model

alias of Snippet

url_identifier = 'xtheme_snippet'
class shuup.xtheme.admin_module.views.TemplateView(**kwargs)[source]

Bases: TemplateResponseMixin, ContextMixin, View

Render a template. Pass keyword arguments from the URLconf to the context.

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

get(request, *args, **kwargs)[source]
class shuup.xtheme.admin_module.views.ThemeConfigDetailView(**kwargs)[source]

Bases: CreateOrUpdateView

A view for configuring a single theme.

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

add_form_errors_as_messages = True
context_object_name = 'theme_settings'
form_class

alias of Form

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Return an instance of the form to be used in this view.

get_object(queryset=None)[source]

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

get_theme()[source]

Get the theme object to configure.

Returns:

Theme object.

Return type:

shuup.xtheme.Theme

get_toolbar()[source]
model

alias of ThemeSettings

save_form(form)[source]
template_name = 'shuup/xtheme/admin/config_detail.jinja'
class shuup.xtheme.admin_module.views.ThemeConfigView(**kwargs)[source]

Bases: FormView

A view for listing and activating themes.

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

form_class

alias of ActivationForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

template_name = 'shuup/xtheme/admin/config.jinja'
class shuup.xtheme.admin_module.views.ThemeGuideTemplateView(**kwargs)[source]

Bases: TemplateView

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

dispatch(request, *args, **kwargs)[source]
template_name = None
class shuup.xtheme.admin_module.views.ThemeWizardPane(request, object=None)[source]

Bases: WizardPane

form_valid(form)[source]
get_form_defs()[source]
icon = 'xtheme/theme.png'
identifier = 'theme'
text = 'Choose a theme for your shop'
title = 'Theme'
valid()[source]

Returns whether this pane is valid and should be included in wizard pane list.

visible()[source]

Returns whether this pane is visible for editing.