shuup.notify.models package¶
Submodules¶
shuup.notify.models.email_template module¶
-
class
shuup.notify.models.email_template.EmailTemplate(id, name, template)[source]¶ Bases:
django.db.models.base.ModelParameters: - id (AutoField) – Id
- name (CharField) – Name
- template (TextField) – Enter the base HTML template to be used in emails. Mark the place to inject the email content using the variable
%html_body%inside the body.
-
name¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
template¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
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.notify.models.notification module¶
-
class
shuup.notify.models.notification.NotificationManager[source]¶ Bases:
django.db.models.manager.Manager
-
class
shuup.notify.models.notification.Notification(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelA model for persistent notifications to be shown in the admin, etc.
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop) – Shop - recipient_type (EnumIntegerField) – Recipient type
- recipient (ForeignKey to
django.contrib.auth.models.User) – Recipient - created_on (DateTimeField) – Created on
- message (CharField) – Message
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- priority (EnumIntegerField) – Priority
- _data (JSONField) – data
- marked_read (BooleanField) – Marked read
- marked_read_by (ForeignKey to
django.contrib.auth.models.User) – Marked read by - marked_read_on (DateTimeField) – Marked read on
-
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.parentis aForwardManyToOneDescriptorinstance.
-
recipient_type¶ A property descriptor which ensures that
field.to_python()is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creatorclass, which in turn was used by the deprecated-in-Django-1.10SubfieldBaseclass, hence the reimplementation here.
-
recipient¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
created_on¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
message¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
priority¶ A property descriptor which ensures that
field.to_python()is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creatorclass, which in turn was used by the deprecated-in-Django-1.10SubfieldBaseclass, hence the reimplementation here.
-
marked_read¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
marked_read_by¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
marked_read_on¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects= <shuup.notify.models.notification.NotificationManager object>¶
-
is_read¶
-
data¶
-
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)¶
-
get_priority_display(*, field=<enumfields.fields.EnumIntegerField: priority>)¶
-
get_recipient_type_display(*, field=<enumfields.fields.EnumIntegerField: recipient_type>)¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
marked_read_by_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
recipient_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.
-
url¶
shuup.notify.models.script module¶
-
class
shuup.notify.models.script.Script(id, shop, event_identifier, identifier, created_on, name, enabled, _step_data, template)[source]¶ Bases:
django.db.models.base.ModelParameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop) – Shop - event_identifier (CharField) – Event identifier
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- created_on (DateTimeField) – Created on
- name (CharField) – Name
- enabled (BooleanField) – Enabled
- _step_data (JSONField) – step data
- template (CharField) – the template identifier used to create this script
-
log_entries¶ ManyToOneRel to
shuup.notify.models.script.ScriptLogEntry
-
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.parentis aForwardManyToOneDescriptorinstance.
-
event_identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_on¶ 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.
-
enabled¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
template¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
event_class¶
-
execute(context)[source]¶ Execute the script in the given context.
Parameters: context (shuup.notify.script.Context) – Script context
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
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.
-
log_entries 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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
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.
-
class
shuup.notify.models.script.ScriptLogEntry(id, created_on, user, message, identifier, kind, extra, target)¶ Bases:
shuup.utils.analog.BaseLogEntryParameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- user (ForeignKey to
django.contrib.auth.models.User) – User - message (CharField) – Message
- identifier (CharField) – Identifier
- kind (EnumIntegerField) – Log entry kind
- extra (JSONField) – Extra data
- target (ForeignKey to
shuup.notify.models.script.Script) – Target
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
extra¶ A placeholder class that provides a way to set the attribute on the model.
-
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.
-
kind¶ A property descriptor which ensures that
field.to_python()is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creatorclass, which in turn was used by the deprecated-in-Django-1.10SubfieldBaseclass, hence the reimplementation here.
-
objects= <django.db.models.manager.Manager object>¶
-
target¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
target_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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.parentis aForwardManyToOneDescriptorinstance.
Module contents¶
-
class
shuup.notify.models.EmailTemplate(id, name, template)[source]¶ Bases:
django.db.models.base.ModelParameters: - id (AutoField) – Id
- name (CharField) – Name
- template (TextField) – Enter the base HTML template to be used in emails. Mark the place to inject the email content using the variable
%html_body%inside the body.
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
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>¶
-
template¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.notify.models.Notification(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelA model for persistent notifications to be shown in the admin, etc.
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop) – Shop - recipient_type (EnumIntegerField) – Recipient type
- recipient (ForeignKey to
django.contrib.auth.models.User) – Recipient - created_on (DateTimeField) – Created on
- message (CharField) – Message
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- priority (EnumIntegerField) – Priority
- _data (JSONField) – data
- marked_read (BooleanField) – Marked read
- marked_read_by (ForeignKey to
django.contrib.auth.models.User) – Marked read by - marked_read_on (DateTimeField) – Marked read on
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
created_on¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
data¶
-
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)¶
-
get_priority_display(*, field=<enumfields.fields.EnumIntegerField: priority>)¶
-
get_recipient_type_display(*, field=<enumfields.fields.EnumIntegerField: recipient_type>)¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_read¶
-
marked_read¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
marked_read_by¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
marked_read_by_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
marked_read_on¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
message¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects= <shuup.notify.models.notification.NotificationManager object>¶
-
priority¶ A property descriptor which ensures that
field.to_python()is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creatorclass, which in turn was used by the deprecated-in-Django-1.10SubfieldBaseclass, hence the reimplementation here.
-
recipient¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
recipient_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
recipient_type¶ A property descriptor which ensures that
field.to_python()is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creatorclass, which in turn was used by the deprecated-in-Django-1.10SubfieldBaseclass, hence the reimplementation here.
-
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.parentis aForwardManyToOneDescriptorinstance.
-
shop_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
url¶
-
class
shuup.notify.models.Script(id, shop, event_identifier, identifier, created_on, name, enabled, _step_data, template)[source]¶ Bases:
django.db.models.base.ModelParameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop) – Shop - event_identifier (CharField) – Event identifier
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- created_on (DateTimeField) – Created on
- name (CharField) – Name
- enabled (BooleanField) – Enabled
- _step_data (JSONField) – step data
- template (CharField) – the template identifier used to create this script
-
log_entries¶ ManyToOneRel to
shuup.notify.models.script.ScriptLogEntry
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
created_on¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
enabled¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
event_class¶
-
event_identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
execute(context)[source]¶ Execute the script in the given context.
Parameters: context (shuup.notify.script.Context) – Script context
-
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.
-
identifier¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries 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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
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>¶
-
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.parentis aForwardManyToOneDescriptorinstance.
-
shop_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
template¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.