shuup.notify.admin_module.views package

Submodules

shuup.notify.admin_module.views.delete module

class shuup.notify.admin_module.views.delete.ScriptDeleteView(**kwargs)[source]

Bases: DetailView

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

model

alias of Script

get_success_url()[source]
post(request, *args, **kwargs)[source]

shuup.notify.admin_module.views.edit module

class shuup.notify.admin_module.views.edit.ScriptEditView(**kwargs)[source]

Bases: CreateOrUpdateView

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

model

alias of Script

form_class

alias of ScriptForm

template_name = 'notify/admin/edit_script.jinja'
context_object_name = 'script'
get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

form_valid(form)[source]

If the form is valid, save the associated model.

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.

shuup.notify.admin_module.views.editor module

shuup.notify.admin_module.views.editor.script_item_editor(request)[source]
class shuup.notify.admin_module.views.editor.ScriptAPI(request, script)[source]

Bases: object

Parameters:
__init__(request, script)[source]
Parameters:
dispatch()[source]
handle_get_data(data)[source]
handle_save_data(data)[source]
class shuup.notify.admin_module.views.editor.EditScriptContentView(**kwargs)[source]

Bases: DetailView

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

template_name = 'notify/admin/script_content_editor.jinja'
model

alias of Script

context_object_name = 'script'
post(request, *args, **kwargs)[source]
get_context_data(**kwargs)[source]

Insert the single object into the context dict.

shuup.notify.admin_module.views.email_template module

class shuup.notify.admin_module.views.email_template.EmailTemplateForm(**kwargs)[source]

Bases: ShuupAdminFormNoTranslation

class Meta[source]

Bases: object

model

alias of EmailTemplate

fields = ('name', 'template')
widgets = {'template': <class 'shuup.admin.forms.widgets.CodeEditorWithHTMLPreview'>}
base_fields = {'name': <django.forms.fields.CharField object>, 'template': <django.forms.fields.CharField object>}
declared_fields = {}
property media

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

class shuup.notify.admin_module.views.email_template.EmailTemplateEditView(**kwargs)[source]

Bases: CreateOrUpdateView

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

model

alias of EmailTemplate

form_class

alias of EmailTemplateForm

template_name = 'notify/admin/email_template_edit.jinja'
context_object_name = 'email_template'
get_toolbar()[source]
class shuup.notify.admin_module.views.email_template.EmailTemplateDeleteView(**kwargs)[source]

Bases: DetailView

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

model

alias of EmailTemplate

post(request, *args, **kwargs)[source]
class shuup.notify.admin_module.views.email_template.EmailTemplateListView[source]

Bases: PicotableListView

model

alias of EmailTemplate

url_identifier = 'notify.email_template'
default_columns = [<Column: Name> name]
toolbar_buttons_provider_key: str | None = 'email_template_list_toolbar_provider'
mass_actions_provider_key: str | None = 'email_template_list_mass_actions_provider'

shuup.notify.admin_module.views.list module

class shuup.notify.admin_module.views.list.ScriptListView[source]

Bases: PicotableListView

template_name = 'notify/admin/list_script.jinja'
model

alias of Script

default_columns = [<Column: Name> name, <Column: Event> event_identifier, <Column: Enabled> enabled]
toolbar_buttons_provider_key: str | None = 'notify_list_toolbar_provider'
mass_actions_provider_key: str | None = 'notify_list_actions_provider'
get_object_url(instance)[source]
get_event_identifier_text(instance)[source]
get_toolbar()[source]
get_object_abstract(instance, item)[source]

Get the object abstract lines (used for mobile layouts) for this object.

Supported keys in abstract line dicts are:

  • text (required)

  • title

  • class (CSS class name – header for instance)

  • raw (boolean; whether or not the text is raw HTML)

Parameters:
  • instance – The instance.

  • item – The item dict so far. Useful for reusing precalculated values.

Returns:

Iterable of dicts to pass through to the picotable javascript.

Return type:

Iterable[dict]

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.

shuup.notify.admin_module.views.template module

class shuup.notify.admin_module.views.template.EditScriptMode[source]

Bases: object

CREATE = 'create'
MODIFY = 'modify'
class shuup.notify.admin_module.views.template.ScriptTemplateView(**kwargs)[source]

Bases: TemplateView

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

template_name = 'notify/admin/script_templates.jinja'
get_context_data(**kwargs)[source]

Put all the script templates on disposal of the user.

post(request)[source]

Create the Script from template directly if the template does not have a bound form.

If the script template has a bound form, redirect to the template configuration view.

If no script template is found, redirect to the script list.

class shuup.notify.admin_module.views.template.ScriptTemplateConfigView(**kwargs)[source]

Bases: FormView

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

template_name = 'notify/admin/script_template_config.jinja'
success_url = 'shuup_admin:notify.script.list'
dispatch(request, *args, **kwargs)[source]

Check if the request parameter id has a valid script template.

get_form(form_class=None)[source]

Create and return the configuration form.

form_valid(form)[source]

Create the script from the template using the configuration from the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

class shuup.notify.admin_module.views.template.ScriptTemplateEditView(**kwargs)[source]

Bases: FormView

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

template_name = 'notify/admin/script_template_config.jinja'
success_url = 'shuup_admin:notify.script.list'
instance = None
dispatch(request, *args, **kwargs)[source]

Check if the request parameter pk has a valid templated Script instance.

get_form(form_class=None)[source]

Create and return the configuration form.

form_valid(form)[source]

Create the script from the template using the configuration from the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

Module contents

shuup.notify.admin_module.views.script_item_editor(request)[source]
class shuup.notify.admin_module.views.ScriptEditView(**kwargs)[source]

Bases: CreateOrUpdateView

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

context_object_name = 'script'
form_class

alias of ScriptForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

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 Script

template_name = 'notify/admin/edit_script.jinja'
class shuup.notify.admin_module.views.EditScriptContentView(**kwargs)[source]

Bases: DetailView

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

context_object_name = 'script'
get_context_data(**kwargs)[source]

Insert the single object into the context dict.

model

alias of Script

post(request, *args, **kwargs)[source]
template_name = 'notify/admin/script_content_editor.jinja'
class shuup.notify.admin_module.views.ScriptListView[source]

Bases: PicotableListView

default_columns = [<Column: Name> name, <Column: Event> event_identifier, <Column: Enabled> enabled]
get_event_identifier_text(instance)[source]
get_object_abstract(instance, item)[source]

Get the object abstract lines (used for mobile layouts) for this object.

Supported keys in abstract line dicts are:

  • text (required)

  • title

  • class (CSS class name – header for instance)

  • raw (boolean; whether or not the text is raw HTML)

Parameters:
  • instance – The instance.

  • item – The item dict so far. Useful for reusing precalculated values.

Returns:

Iterable of dicts to pass through to the picotable javascript.

Return type:

Iterable[dict]

get_object_url(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.

get_toolbar()[source]
mass_actions_provider_key: str | None = 'notify_list_actions_provider'
model

alias of Script

template_name = 'notify/admin/list_script.jinja'
toolbar_buttons_provider_key: str | None = 'notify_list_toolbar_provider'
class shuup.notify.admin_module.views.ScriptTemplateView(**kwargs)[source]

Bases: TemplateView

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

get_context_data(**kwargs)[source]

Put all the script templates on disposal of the user.

post(request)[source]

Create the Script from template directly if the template does not have a bound form.

If the script template has a bound form, redirect to the template configuration view.

If no script template is found, redirect to the script list.

template_name = 'notify/admin/script_templates.jinja'
class shuup.notify.admin_module.views.ScriptTemplateConfigView(**kwargs)[source]

Bases: FormView

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

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

Check if the request parameter id has a valid script template.

form_valid(form)[source]

Create the script from the template using the configuration from the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Create and return the configuration form.

success_url = 'shuup_admin:notify.script.list'
template_name = 'notify/admin/script_template_config.jinja'
class shuup.notify.admin_module.views.ScriptTemplateEditView(**kwargs)[source]

Bases: FormView

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

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

Check if the request parameter pk has a valid templated Script instance.

form_valid(form)[source]

Create the script from the template using the configuration from the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Create and return the configuration form.

instance = None
success_url = 'shuup_admin:notify.script.list'
template_name = 'notify/admin/script_template_config.jinja'