Notifications Apps

class apps.notifications.models.Notification(*args, **kwargs)[source]

Bases: Model

Notification Model

Parameters:

Relationship fields:

Parameters:
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created_at

Type: DateTimeField

Created_at

data

Type: JSONField

Data

get_next_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=True, **kwargs)

Finds next instance based on created_at. See get_next_by_FOO() for more information.

get_previous_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=False, **kwargs)

Finds previous instance based on created_at. See get_previous_by_FOO() for more information.

get_type_display(*, field=<django.db.models.CharField: type>)

Shows the label of the type. See get_FOO_display() for more information.

id

Type: BigAutoField

Primary key: ID

is_read

Type: BooleanField

Is read

objects = <django.db.models.Manager object>
post

Type: ForeignKey to Post

Post (related name: notifications)

post_id

Internal field, use post instead.

receiver

Type: ForeignKey to User

Receiver (related name: notifications)

receiver_id

Internal field, use receiver instead.

sender

Type: ForeignKey to User

Sender (related name: sender)

sender_id

Internal field, use sender instead.

type

Type: CharField

Type

Choices:

  • like

  • comment

  • follow

  • publish

  • publish_followers

class apps.notifications.admin.NotificationAdminModel(model, admin_site)[source]

Bases: ModelAdmin

Notification Admin Model

property media
class apps.notifications.constants.NotificationTypeChoices(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: TextChoices

COMMENT = 'comment'
FOLLOW = 'follow'
LIKE = 'like'
PUBLISH = 'publish'
PUBLISH_FOLLOWERS = 'publish_followers'
class apps.notifications.apps.NotificationsConfig(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.notifications'
verbose_name = 'Notification'