Skip to content

bovine_timeline.models

ConversationElement

Bases: Model

Used to track all objects stored of a conversation

Source code in bovine_timeline/models.py
72
73
74
75
76
77
78
79
80
81
class ConversationElement(Model):
    """Used to track all objects stored of a conversation"""

    id = fields.IntField(pk=True)
    """id"""

    conversation_root = fields.CharField(max_length=255)
    """The root element of the conversation"""
    object_id = fields.CharField(max_length=255)
    """The element of the conversation"""

conversation_root = fields.CharField(max_length=255) class-attribute instance-attribute

The root element of the conversation

id = fields.IntField(pk=True) class-attribute instance-attribute

id

object_id = fields.CharField(max_length=255) class-attribute instance-attribute

The element of the conversation

Interaction

Bases: Model

Represents an interaction done by the user

Source code in bovine_timeline/models.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Interaction(Model):
    """Represents an interaction done by the user"""

    id = fields.IntField(pk=True)
    """The id"""

    activity_id = fields.CharField(max_length=255, null=True)
    """The id of the activity"""

    interaction = fields.CharEnumField(InteractionType)
    """Represents the type of interaction"""

    summary = fields.CharField(max_length=255)
    """Used as textual description"""

    object_id = fields.CharField(max_length=255)
    """The id of the object being interacted with"""

    conversation_root = fields.CharField(max_length=255, null=True)
    """For post and reply, the root element of the conversation"""

    created = fields.DatetimeField(auto_now_add=True)
    """The creation time"""

activity_id = fields.CharField(max_length=255, null=True) class-attribute instance-attribute

The id of the activity

conversation_root = fields.CharField(max_length=255, null=True) class-attribute instance-attribute

For post and reply, the root element of the conversation

created = fields.DatetimeField(auto_now_add=True) class-attribute instance-attribute

The creation time

id = fields.IntField(pk=True) class-attribute instance-attribute

The id

interaction = fields.CharEnumField(InteractionType) class-attribute instance-attribute

Represents the type of interaction

object_id = fields.CharField(max_length=255) class-attribute instance-attribute

The id of the object being interacted with

summary = fields.CharField(max_length=255) class-attribute instance-attribute

Used as textual description

InteractionType

Bases: StrEnum

Interaction types, currently like, share, reply, and post.

Source code in bovine_timeline/models.py
 7
 8
 9
10
11
12
13
class InteractionType(StrEnum):
    """Interaction types, currently like, share, reply, and post."""

    LIKE = auto()
    SHARE = auto()
    REPLY = auto()
    POST = auto()

PublicObject

Bases: Model

Represents a public ActivityPub / Fediverse object. In its basic form it is a JSON object with an id.

Source code in bovine_timeline/models.py
41
42
43
44
45
46
47
48
class PublicObject(Model):
    """Represents a public ActivityPub / Fediverse object. In its basic
    form it is a JSON object with an id."""

    object_id = fields.CharField(max_length=255, pk=True)
    data = fields.JSONField()

    created = fields.DatetimeField(auto_now=True)

RemoteActor

Bases: Model

Stores a remote actor by its actor_id (the uri)

Source code in bovine_timeline/models.py
51
52
53
54
55
56
57
class RemoteActor(Model):
    """Stores a remote actor by its actor_id (the uri)"""

    actor_id = fields.CharField(max_length=255, pk=True)
    """The URI corresponding to the actor"""
    data = fields.JSONField()
    """The actor profile"""

actor_id = fields.CharField(max_length=255, pk=True) class-attribute instance-attribute

The URI corresponding to the actor

data = fields.JSONField() class-attribute instance-attribute

The actor profile

RemoteObject

Bases: Model

Stores a remote object

Source code in bovine_timeline/models.py
60
61
62
63
64
65
66
67
68
69
class RemoteObject(Model):
    """Stores a remote object"""

    object_id = fields.CharField(max_length=255, pk=True)
    """The URI corresponding to the object"""
    data = fields.JSONField()
    """The content of the object"""

    author = fields.ForeignKeyField("models.RemoteActor")
    """The author of the object"""

author = fields.ForeignKeyField('models.RemoteActor') class-attribute instance-attribute

The author of the object

data = fields.JSONField() class-attribute instance-attribute

The content of the object

object_id = fields.CharField(max_length=255, pk=True) class-attribute instance-attribute

The URI corresponding to the object