shuup.importer.admin_module package

Submodules

shuup.importer.admin_module.forms module

class shuup.importer.admin_module.forms.ImportSettingsForm(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

base_fields = {'import_mode': <enumfields.forms.EnumChoiceField object>}
declared_fields = {'import_mode': <enumfields.forms.EnumChoiceField object>}
property media

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

class shuup.importer.admin_module.forms.ImportForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
base_fields = {'file': <django.forms.fields.FileField object>, 'importer': <django.forms.fields.ChoiceField object>, 'language': <django.forms.fields.ChoiceField object>}
declared_fields = {'file': <django.forms.fields.FileField object>, 'importer': <django.forms.fields.ChoiceField object>, 'language': <django.forms.fields.ChoiceField object>}
property media

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

shuup.importer.admin_module.import_views module

class shuup.importer.admin_module.import_views.ImporterPicotable(request, columns, mass_actions, queryset, context)[source]

Bases: Picotable

get_verbose_name_plural()[source]
class shuup.importer.admin_module.import_views.ImportProcessView(**kwargs)[source]

Bases: TemplateView

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

template_name = 'shuup/importer/admin/import_process.jinja'
dispatch(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
get_context_data(**kwargs)[source]
get(request, *args, **kwargs)[source]
class shuup.importer.admin_module.import_views.ImportView(**kwargs)[source]

Bases: FormView

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

template_name = 'shuup/importer/admin/import.jinja'
form_class

alias of ImportForm

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

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

class shuup.importer.admin_module.import_views.ExampleFileDownloadView(**kwargs)[source]

Bases: View

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

get(request, *args, **kwargs)[source]
shuup.importer.admin_module.import_views.get_imports_queryset(request)[source]
class shuup.importer.admin_module.import_views.ImportListView(*args, **kwargs)[source]

Bases: PicotableListView

picotable_class

alias of ImporterPicotable

model

alias of BackgroundTaskExecution

default_columns = [<Column: Import date> started_on, <Column: Importer> importer, <Column: Import mode> import_mode, <Column: User> user, <Column: Status> status]
toolbar_buttons_provider_key: str | None = 'import_list_toolbar_provider'
mass_actions_provider_key: str | None = 'import_list_mass_actions_provider'
__init__(*args, **kwargs)[source]
get_importer(instance)[source]
get_user(instance)[source]
get_import_mode(instance)[source]
get_context_data(**kwargs)[source]

Get the context for this view.

get_toolbar()[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_object_url(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]

class shuup.importer.admin_module.import_views.ImportDetailView(**kwargs)[source]

Bases: DetailView

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

model

alias of BackgroundTaskExecution

template_name = 'shuup/importer/admin/import_process_complete.jinja'
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_context_data(**kwargs)[source]

Insert the single object into the context dict.

Module contents

class shuup.importer.admin_module.ImportAdminModule[source]

Bases: AdminModule

name = 'Data Import'
breadcrumbs_menu_entry = <shuup.admin.base.MenuEntry object>
get_extra_permissions()[source]

Define custom extra permissions for admin module for option to limit certain parts of the admin module based on per user permission string. Should return unique list permission strings across the installation to prevent unwanted side effects.

Return type:

list[str]

get_permissions_help_texts()[source]

Returns a dictionary where the keys is the permission identifier and the value is a help text that can help the user to understand where the permissions is used and how it works.

get_urls()[source]
Return type:

list[django.urls.RegexURLPattern]

get_menu_entries(request)[source]
Return type:

list[shuup.admin.base.MenuEntry]