magic_notifier.models

Module Contents

Classes

JSONField

Simple JSON field that stores python structures as JSON strings

Notification

NotifyProfile

Attributes

User

class magic_notifier.models.JSONField(*args, db_collation=None, **kwargs)

Bases: django.db.models.TextField

Simple JSON field that stores python structures as JSON strings on database.

from_db_value(value, *args, **kwargs)
to_python(value)

Convert the input JSON value into python structures, raises django.core.exceptions.ValidationError if the data can’t be converted.

validate(value, model_instance)

Check value is a valid JSON string, raise ValidationError on error.

get_prep_value(value)

Convert value to JSON string before save

value_from_object(obj)

Return value dumped to string.

magic_notifier.models.User
class magic_notifier.models.Notification(*args, **kwargs)

Bases: django.db.models.Model

id
user: django.db.models.ForeignKey
subject: django.db.models.CharField
text: django.db.models.TextField
type: django.db.models.CharField
sub_type: django.db.models.CharField
image: django.db.models.ImageField
actions: django.db.models.JSONField
data: django.db.models.JSONField
read: django.db.models.DateTimeField
sent: django.db.models.DateTimeField
mode: django.db.models.CharField
__str__()
save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

mark_read()
class magic_notifier.models.NotifyProfile(*args, **kwargs)

Bases: django.db.models.Model

id
phone_number: django.db.models.CharField
current_channel: django.db.models.CharField
user: django.db.models.OneToOneField