magic_notifier.models
Module Contents
Classes
Simple JSON field that stores python structures as JSON strings |
|
Attributes
- class magic_notifier.models.JSONField(*args, db_collation=None, **kwargs)
Bases:
django.db.models.TextFieldSimple 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
- link: 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()