shuup.notify.models package

Submodules

shuup.notify.models.notification module

class shuup.notify.models.notification.NotificationManager[source]

Bases: django.db.models.manager.Manager

for_user(user)[source]
unread_for_user(user)[source]
class shuup.notify.models.notification.Notification(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A model for persistent notifications to be shown in the admin, etc.

Parameters:
  • id (AutoField) – Id
  • 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
recipient_type

A placeholder class that provides a way to set the attribute on the model.

recipient
priority

A placeholder class that provides a way to set the attribute on the model.

marked_read_by
objects = <shuup.notify.models.notification.NotificationManager object>
save(*args, **kwargs)[source]
mark_read(user)[source]
is_read
data
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Notification.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Notification.get_next_by_created_on(*moreargs, **morekwargs)
Notification.get_previous_by_created_on(*moreargs, **morekwargs)
Notification.get_priority_display(*moreargs, **morekwargs)
Notification.get_recipient_type_display(*moreargs, **morekwargs)
Notification.url
Notification.set_reverse_url(**reverse_kwargs)[source]

shuup.notify.models.script module

class shuup.notify.models.script.Script(id, event_identifier, identifier, created_on, name, enabled, _step_data, template)[source]

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • 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
get_steps()[source]

:rtype Iterable[Step]

set_steps(steps)[source]
get_serialized_steps()[source]
set_serialized_steps(serialized_data)[source]
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 Script.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Script.get_next_by_created_on(*moreargs, **morekwargs)
Script.get_previous_by_created_on(*moreargs, **morekwargs)
Script.objects = <django.db.models.manager.Manager object>

Module contents

class shuup.notify.models.Notification(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A model for persistent notifications to be shown in the admin, etc.

Parameters:
  • id (AutoField) – Id
  • 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 Notification.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Notification.data
Notification.get_next_by_created_on(*moreargs, **morekwargs)
Notification.get_previous_by_created_on(*moreargs, **morekwargs)
Notification.get_priority_display(*moreargs, **morekwargs)
Notification.get_recipient_type_display(*moreargs, **morekwargs)
Notification.is_read
Notification.mark_read(user)[source]
Notification.marked_read_by
Notification.objects = <shuup.notify.models.notification.NotificationManager object>
Notification.priority

A placeholder class that provides a way to set the attribute on the model.

Notification.recipient
Notification.recipient_type

A placeholder class that provides a way to set the attribute on the model.

Notification.save(*args, **kwargs)[source]
Notification.set_reverse_url(**reverse_kwargs)[source]
Notification.url
class shuup.notify.models.Script(id, event_identifier, identifier, created_on, name, enabled, _step_data, template)[source]

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • 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
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Script.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Script.event_class
Script.execute(context)[source]

Execute the script in the given context.

Parameters:context (shuup.notify.script.Context) – Script context
Script.get_next_by_created_on(*moreargs, **morekwargs)
Script.get_previous_by_created_on(*moreargs, **morekwargs)
Script.get_serialized_steps()[source]
Script.get_steps()[source]

:rtype Iterable[Step]

Script.objects = <django.db.models.manager.Manager object>
Script.set_serialized_steps(serialized_data)[source]
Script.set_steps(steps)[source]