Skip to content

Model Reference

Linked Data

These are model classes that are used to map Linked Data resources as Django model Objects

activitypub.models.LinkedDataModel

Bases: Model

An abstract model class that can handle conversion to/from JSON-LD to the Django model

serialize(*args, **kw)

Serializes the model class into a dictionary just with its attributes. This is the method that most classes will be interested in overriding.

to_jsonld()

Takes the serialized data and enriches with the entries related to associated JSON-lD contexts

activitypub.models.Reference

Bases: StatusModel

ActivityStreams Vocabulary

These models are to hold the "proper" data objects that according to ActivityStreams:

Core Types

activitypub.models.CoreType

Bases: CoreType

activitypub.models.BaseActivityStreamsObject

Bases: CoreType

activitypub.models.Collection

activitypub.models.CollectionItem

Bases: Model

activitypub.models.Object

activitypub.models.Actor

activitypub.models.Activity

Helper / Extended attributes

Model Classes that hold data from AS types that extend the basic Object/Link attributes

activitypub.models.LinkRelation

Bases: Model

activitypub.models.QuestionExtraData

activitypub.models.RelationshipProperties

Bases: Model

Keypair Management

The integrity of the messages being exchanged between servers rely on cryptographically signed messages. To exchange information about keys and who owns them, the Security Vocabulary is used by ActivityPub.

activitypub.models.CryptographicKeyPair

Bases: LinkedDataModel

verify_document(document)

Verifies a document