shuup.gdpr.admin_module package

Submodules

shuup.gdpr.admin_module.forms module

class shuup.gdpr.admin_module.forms.QuickAddPageSelect(attrs=None, choices=(), editable_model=None, initial=None, model=None)[source]

Bases: QuickAddRelatedObjectSelect

Parameters:

int (initial) – primary key of the object that is initially selected

url = '/sa/cms/page/new/'
property media
class shuup.gdpr.admin_module.forms.QuickAddPageMultiSelect(attrs=None, choices=(), editable_model=None, initial=None, model=None)[source]

Bases: QuickAddRelatedObjectMultiSelect

Parameters:

list[int] (initial) – list of primary keys of the objects that are initially selected

url = '/sa/cms/page/new/'
property media
class shuup.gdpr.admin_module.forms.GDPRSettingsForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

exclude = ('shop',)
model

alias of GDPRSettings

widgets = {'auth_consent_text': <shuup.admin.forms.widgets.TextEditorWidget object>, 'consent_pages': <shuup.gdpr.admin_module.forms.QuickAddPageMultiSelect object>, 'cookie_banner_content': <shuup.admin.forms.widgets.TextEditorWidget object>, 'cookie_privacy_excerpt': <shuup.admin.forms.widgets.TextEditorWidget object>, 'privacy_policy_page': <shuup.gdpr.admin_module.forms.QuickAddPageSelect object>}
__init__(**kwargs)[source]
base_fields = {'auth_consent_text': <django.forms.fields.CharField object>, 'consent_pages': <django.forms.models.ModelMultipleChoiceField object>, 'cookie_banner_content': <django.forms.fields.CharField object>, 'cookie_privacy_excerpt': <django.forms.fields.CharField object>, 'enabled': <django.forms.fields.BooleanField object>, 'privacy_policy_page': <django.forms.models.ModelChoiceField object>, 'skip_consent_on_auth': <django.forms.fields.BooleanField object>}
declared_fields = {'auth_consent_text': <django.forms.fields.CharField object>, 'cookie_banner_content': <django.forms.fields.CharField object>, 'cookie_privacy_excerpt': <django.forms.fields.CharField object>}
property media

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

class shuup.gdpr.admin_module.forms.GDPRCookieCategoryForm(**kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

exclude = ('shop',)
model

alias of GDPRCookieCategory

widgets = {'cookies': <django.forms.widgets.TextInput object>}
base_fields = {'always_active': <django.forms.fields.BooleanField object>, 'block_snippets': <django.forms.models.ModelMultipleChoiceField object>, 'cookies': <django.forms.fields.CharField object>, 'default_active': <django.forms.fields.BooleanField object>, 'how_is_used': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>}
declared_fields = {'how_is_used': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>}
property media

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

class shuup.gdpr.admin_module.forms.GDPRBaseFormPart(request, object=None)[source]

Bases: FormPart

priority: int = -1000
get_form_defs()[source]
form_valid(form)[source]
class shuup.gdpr.admin_module.forms.GDPRCookieCategoryFormSet(*args, **kwargs)[source]

Bases: BaseModelFormSet

form_class

alias of GDPRCookieCategoryForm

validate_min = False
can_delete = True
can_order = False
validate_max = False
min_num = 0
max_num = 1000
absolute_max = 1000
model

alias of GDPRCookieCategory

extra = 1
__init__(*args, **kwargs)[source]
get_queryset()[source]
form(**kwargs)[source]
property can_delete_extra
property empty_form
save(commit=True)[source]

Save model instances for every form, adding and changing instances as necessary, and return the list of instances.

class shuup.gdpr.admin_module.forms.GDPRCookieCategoryFormPart(request, object=None)[source]

Bases: FormPart

name = 'cookie_categories'
formset

alias of GDPRCookieCategoryFormSet

get_form_defs()[source]
form_valid(form)[source]

shuup.gdpr.admin_module.toolbar module

class shuup.gdpr.admin_module.toolbar.AnonymizeContactToolbarButton(object, **kwargs)[source]

Bases: PostActionButton

Parameters:
  • text – The actual text for the button.

  • icon – Icon CSS class string

  • disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.

  • tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.

  • extra_css_class (str) – Extra CSS class(es)

  • required_permissions (Iterable[str]) – Optional iterable of permission strings

__init__(object, **kwargs)[source]
Parameters:
  • text – The actual text for the button.

  • icon – Icon CSS class string

  • disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.

  • tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.

  • extra_css_class (str) – Extra CSS class(es)

  • required_permissions (Iterable[str]) – Optional iterable of permission strings

static visible_for_object(object)[source]
class shuup.gdpr.admin_module.toolbar.DownloadDataToolbarButton(object, **kwargs)[source]

Bases: PostActionButton

Parameters:
  • text – The actual text for the button.

  • icon – Icon CSS class string

  • disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.

  • tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.

  • extra_css_class (str) – Extra CSS class(es)

  • required_permissions (Iterable[str]) – Optional iterable of permission strings

__init__(object, **kwargs)[source]
Parameters:
  • text – The actual text for the button.

  • icon – Icon CSS class string

  • disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.

  • tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.

  • extra_css_class (str) – Extra CSS class(es)

  • required_permissions (Iterable[str]) – Optional iterable of permission strings

static visible_for_object(object)[source]

shuup.gdpr.admin_module.views module

class shuup.gdpr.admin_module.views.GDPRView(**kwargs)[source]

Bases: SaveFormPartsMixin, FormPartsViewMixin, CreateOrUpdateView

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

model

alias of GDPRSettings

template_name = 'shuup/admin/gdpr/edit.jinja'
base_form_part_classes: Any | Any = [<class 'shuup.gdpr.admin_module.forms.GDPRBaseFormPart'>, <class 'shuup.gdpr.admin_module.forms.GDPRCookieCategoryFormPart'>]
success_url = '/sa/gdpr/'
get_toolbar()[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.

get_object()[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_context_data(**kwargs)[source]

Insert the form into the context dict.

form_valid(form)[source]

If the form is valid, save the associated model.

class shuup.gdpr.admin_module.views.BaseContactView(**kwargs)[source]

Bases: SingleObjectMixin, View

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

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.

class shuup.gdpr.admin_module.views.GDPRDownloadDataView(**kwargs)[source]

Bases: BaseContactView

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

post(request, *args, **kwargs)[source]
class shuup.gdpr.admin_module.views.GDPRAnonymizeView(**kwargs)[source]

Bases: BaseContactView

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

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

Module contents

class shuup.gdpr.admin_module.GDPRModule[source]

Bases: AdminModule

name = 'GDPR'
get_urls()[source]
Return type:

list[django.urls.RegexURLPattern]

get_menu_entries(request)[source]
Return type:

list[shuup.admin.base.MenuEntry]