shuup.gdpr package¶
Subpackages¶
Submodules¶
shuup.gdpr.anonymizer module¶
-
class
shuup.gdpr.anonymizer.
Anonymizer
[source]¶ Bases:
object
-
mapping
= {'phone': 'null_phone', 'ip_address': 'null_ip', 'first_name': 'null_name', 'last_name': 'null_name', 'name': 'null_name', 'postal_code': 'null_zip', 'zip_code': 'null_zip', 'www': 'blank_value', 'prefix': 'blank_value', 'suffix': 'blank_value', 'name_ext': 'blank_value', 'merchant_notes': 'blank_value', 'street': 'random_string', 'street1': 'random_string', 'street2': 'random_string', 'street3': 'random_string', 'street_address': 'random_string', 'tax_number': 'random_number', 'city': 'random_string', 'longitude': 'none_value', 'latitude': 'none_value', 'birth_date': 'none_value', 'data': 'none_value', 'email': 'null_email', 'username': 'random_username'}¶
-
shuup.gdpr.apps module¶
-
class
shuup.gdpr.apps.
AppConfig
(*args, **kwargs)[source]¶ Bases:
shuup.apps.AppConfig
-
name
= 'shuup.gdpr'¶
-
label
= 'shuup_gdpr'¶
-
provides
= {'admin_module': ['shuup.gdpr.admin_module.GDPRModule'], 'front_urls': ['shuup.gdpr.urls:urlpatterns'], 'customer_dashboard_items': ['shuup.gdpr.dashboard_items:GDPRDashboardItem'], 'admin_contact_toolbar_action_item': ['shuup.gdpr.admin_module.toolbar:AnonymizeContactToolbarButton', 'shuup.gdpr.admin_module.toolbar:DownloadDataToolbarButton'], 'xtheme_resource_injection': ['shuup.gdpr.resources:add_gdpr_consent_resources'], 'front_registration_field_provider': ['shuup.gdpr.providers:GDPRRegistrationFieldProvider'], 'front_auth_form_field_provider': ['shuup.gdpr.providers:GDPRAuthFieldProvider'], 'checkout_confirm_form_field_provider': ['shuup.gdpr.providers:GDPRCheckoutFieldProvider'], 'front_company_registration_form_provider': ['shuup.gdpr.providers:GDPRFormDefProvider']}¶
-
shuup.gdpr.dashboard_items module¶
shuup.gdpr.forms module¶
shuup.gdpr.models module¶
-
class
shuup.gdpr.models.
GDPRSettings
(id, shop, enabled, skip_consent_on_auth, privacy_policy_page)[source]¶ Bases:
parler.models.TranslatableModel
Parameters: - id (AutoField) – Id
- shop (OneToOneField to
shuup.core.models.Shop
) – Shop - enabled (BooleanField) – Define if the GDPR is active.
- skip_consent_on_auth (BooleanField) – Do not require consent on login when GDPR is activated.
- privacy_policy_page (ForeignKey to
shuup.simple_cms.models.Page
) – Choose your privacy policy page here. If this page changes, customers will be prompted for new consent. - consent_pages (ManyToManyField to
shuup.simple_cms.models.Page
) – Choose pages here which are being monitored for customer consent. If any of these pages change, the customer is being prompted for a new consent. - cookie_banner_content (TextField) – (Translatable) The text to be presented to users in a pop-up warning.
- cookie_privacy_excerpt (TextField) – (Translatable) The summary text to be presented about cookie privacy.
- auth_consent_text (TextField) – (Translatable) Shown in login page between the form and the button. Optional, but should be considered when the consent on login is disabled.
-
translations
¶ ManyToOneRel to
shuup.gdpr.models.GDPRSettingsTranslation
-
shop
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
enabled
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
skip_consent_on_auth
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
privacy_policy_page
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
consent_pages
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
auth_consent_text
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
privacy_policy_page_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.gdpr.models.
GDPRCookieCategory
(id, shop, always_active, default_active, cookies)[source]¶ Bases:
parler.models.TranslatableModel
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop
) – Shop - always_active (BooleanField) – Always active
- default_active (BooleanField) – whether this cookie category is active by default
- cookies (TextField) – Comma separated list of cookies names, prefix or suffix that will be included in this category, e.g. _ga, mysession, user_c_
- name (CharField) – (Translatable) Name
- how_is_used (TextField) – (Translatable) Describe the purpose of this category of cookies and how it is used.
-
translations
¶ ManyToOneRel to
shuup.gdpr.models.GDPRCookieCategoryTranslation
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
always_active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
default_active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
how_is_used
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.gdpr.models.
GDPRUserConsent
(id, created_on, shop, user)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- shop (ForeignKey to
shuup.core.models.Shop
) – Shop - user (ForeignKey to
django.contrib.auth.models.User
) – User - documents (ManyToManyField to
shuup.gdpr.models.GDPRUserConsentDocument
) – Consent documents
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
documents
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.gdpr.models.
GDPRUserConsentDocument
(id, page, version)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- page (ForeignKey to
shuup.simple_cms.models.Page
) – Page - version (ForeignKey to
reversion.models.Version
) – Version
-
page
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
version
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
gdpruserconsent_set
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
page_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
version_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.gdpr.models.
GDPRCookieCategoryTranslation
(id, language_code, name, how_is_used, master)¶ Bases:
parler.models.TranslatedFieldsModel
Parameters: - id (AutoField) – Id
- language_code (HideChoicesCharField) – Language
- name (CharField) – Name
- how_is_used (TextField) – Describe the purpose of this category of cookies and how it is used.
- master (TranslationsForeignKey to
shuup.gdpr.models.GDPRCookieCategory
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.gdpr.models.DoesNotExist
,shuup.gdpr.models.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
how_is_used
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
master
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
master_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
class
shuup.gdpr.models.
GDPRSettingsTranslation
(id, language_code, cookie_banner_content, cookie_privacy_excerpt, auth_consent_text, master)¶ Bases:
parler.models.TranslatedFieldsModel
Parameters: - id (AutoField) – Id
- language_code (HideChoicesCharField) – Language
- cookie_banner_content (TextField) – The text to be presented to users in a pop-up warning.
- cookie_privacy_excerpt (TextField) – The summary text to be presented about cookie privacy.
- auth_consent_text (TextField) – Shown in login page between the form and the button. Optional, but should be considered when the consent on login is disabled.
- master (TranslationsForeignKey to
shuup.gdpr.models.GDPRSettings
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.gdpr.models.DoesNotExist
,shuup.gdpr.models.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
auth_consent_text
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
master
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
master_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
shuup.gdpr.providers module¶
-
class
shuup.gdpr.providers.
TextOnlyWidget
(attrs=None)[source]¶ Bases:
django.forms.widgets.Widget
-
media
¶
-
-
class
shuup.gdpr.providers.
GDPRFieldProvider
(**kwargs)[source]¶ Bases:
shuup.front.providers.form_fields.FormFieldProvider
-
error_message
= ''¶
-
-
class
shuup.gdpr.providers.
GDPRRegistrationFieldProvider
(**kwargs)[source]¶ Bases:
shuup.gdpr.providers.GDPRFieldProvider
-
error_message
= 'You must accept this in order to register.'¶
-
-
class
shuup.gdpr.providers.
GDPRCheckoutFieldProvider
(**kwargs)[source]¶ Bases:
shuup.gdpr.providers.GDPRFieldProvider
-
error_message
= 'You must accept this to order.'¶
-
shuup.gdpr.receivers module¶
-
shuup.gdpr.receivers.
create_consents_company_registration_save
(sender, request, user, company, *args, **kwargs)[source]¶
shuup.gdpr.resources module¶
shuup.gdpr.serializers module¶
-
class
shuup.gdpr.serializers.
ContactLogEntrySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
CompanyContactLogEntrySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶
-
class
shuup.gdpr.serializers.
PersonContactLogEntrySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶
-
class
shuup.gdpr.serializers.
GDPRConsentDocumentSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.Serializer
-
class
shuup.gdpr.serializers.
GDPRConsentCookieCategorySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
GDPRConsentSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
UserSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
AddressSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
OrderLineSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
OrderSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
SavedAddressSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
CoreBasketSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
FrontSavedBasketSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
shuup.gdpr.serializers.
ContactSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
rest_framework.serializers.ModelSerializer
shuup.gdpr.settings module¶
shuup.gdpr.signal_handlers module¶
shuup.gdpr.urls module¶
shuup.gdpr.utils module¶
Parameters: cookie_categories (list[GDPRCookieCategory]) – list of cookie category
-
shuup.gdpr.utils.
is_documents_consent_in_sync
(shop, user)[source]¶ Returns whether the user has consent to the lastest document versions
shuup.gdpr.views module¶
-
class
shuup.gdpr.views.
GDPRCookieConsentView
(**kwargs)[source]¶ Bases:
django.views.generic.base.View
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
class
shuup.gdpr.views.
GDPRPolicyConsentView
(**kwargs)[source]¶ Bases:
django.views.generic.base.View
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
class
shuup.gdpr.views.
GDPRCustomerDashboardView
(**kwargs)[source]¶ Bases:
shuup.front.views.dashboard.DashboardViewMixin
,django.views.generic.base.TemplateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
template_name
= 'shuup/gdpr/edit_customer_data.jinja'¶
-