swh.coarnotify.server.models module#

Models.

class swh.coarnotify.server.models.Organization(*args, **kwargs)[source]#

Bases: Model

An organization.

name#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

url#

Organization URL (for discovery).

inbox#

LDN inbox URL.

created_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

actor_set#

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)#
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)#
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)#
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)#
id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

inboundnotification_set#

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>#
class swh.coarnotify.server.models.ActorManager(*args, **kwargs)[source]#

Bases: BaseUserManager

create_user(email: str, password: str | None = None, **extra_fields) Actor[source]#
create_superuser(email: str, password: str, **extra_fields) Actor[source]#
class swh.coarnotify.server.models.Actor(*args, **kwargs)[source]#

Bases: AbstractUser

A member of an organization.

email#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

organization#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

username = None#
first_name = None#
last_name = None#
objects = <swh.coarnotify.server.models.ActorManager object>#
USERNAME_FIELD = 'email'#
EMAIL_FIELD = 'email'#
REQUIRED_FIELDS = ['organization']#
exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

auth_token#

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

date_joined#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)#
get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)#
groups#

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_active#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_staff#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_superuser#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_login#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

logentry_set#

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

organization_id#
password#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user_permissions#

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class swh.coarnotify.server.models.Statuses(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: TextChoices

PENDING = 'pending'#
REJECTED = 'rejected'#
ACCEPTED = 'accepted'#
PROCESSED = 'processed'#
UNPROCESSABLE = 'unprocessable'#
class swh.coarnotify.server.models.Notification(*args, **kwargs)[source]#

Bases: Model

An abstract model for COAR Notification.

id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

payload#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_message#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class Meta[source]#

Bases: object

abstract = False#
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)#
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)#
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)#
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)#
get_status_display(*, field=<django.db.models.fields.CharField: status>)#
class swh.coarnotify.server.models.InboundNotification(*args, **kwargs)[source]#

Bases: Notification

Our inbox

raw_payload#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

in_reply_to#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sender#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

get_absolute_url() str[source]#
exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

created_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_message#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)#
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)#
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)#
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)#
get_status_display(*, field=<django.db.models.fields.CharField: status>)#
id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

in_reply_to_id#
objects = <django.db.models.manager.Manager object>#
payload#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

replied_by#

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sender_id#
status#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class swh.coarnotify.server.models.OutboundNotification(*args, **kwargs)[source]#

Bases: Notification

Our outbox.

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

created_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error_message#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)#
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)#
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)#
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)#
get_status_display(*, field=<django.db.models.fields.CharField: status>)#
id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

in_reply_to_id#
objects = <django.db.models.manager.Manager object>#
payload#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

replied_by#

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

status#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_at#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

in_reply_to#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.