swh.web.add_forge_now.models module#

class swh.web.add_forge_now.models.RequestStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Request statuses.

Values are used in the ui.

PENDING = 'Pending'#
WAITING_FOR_FEEDBACK = 'Waiting for feedback'#
FEEDBACK_TO_HANDLE = 'Feedback to handle'#
ACCEPTED = 'Accepted'#
SCHEDULED = 'Scheduled'#
FIRST_LISTING_DONE = 'First listing done'#
FIRST_ORIGIN_LOADED = 'First origin loaded'#
REJECTED = 'Rejected'#
SUSPENDED = 'Suspended'#
UNSUCCESSFUL = 'Unsuccessful'#
classmethod choices()[source]#
classmethod next_statuses() Dict[RequestStatus, List[RequestStatus]][source]#
classmethod next_statuses_str() Dict[str, List[str]][source]#
allowed_next_statuses() List[RequestStatus][source]#
class swh.web.add_forge_now.models.RequestActorRole(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

MODERATOR = 'moderator'#
SUBMITTER = 'submitter'#
FORGE_ADMIN = 'forge admin'#
EMAIL = 'email'#
classmethod choices()[source]#
class swh.web.add_forge_now.models.RequestHistory(*args, **kwargs)[source]#

Bases: Model

Comment or status change. This is commented or changed by either submitter or moderator.

request#

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.

text#

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

actor#

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

actor_role#

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

date#

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

new_status#

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

message_source#

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

get_actor_role_display(*, field=<django.db.models.fields.TextField: actor_role>)#
get_new_status_display(*, field=<django.db.models.fields.TextField: new_status>)#
get_next_by_date(*, field=<django.db.models.fields.DateTimeField: date>, is_next=True, **kwargs)#
get_previous_by_date(*, field=<django.db.models.fields.DateTimeField: date>, 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.

objects = <django.db.models.manager.Manager object>#
request_id#
class swh.web.add_forge_now.models.Request(id, status, submission_date, submitter_name, submitter_email, submitter_forward_username, forge_type, forge_url, forge_contact_email, forge_contact_name, forge_contact_comment, last_moderator, last_modified_date)[source]#

Bases: Model

status#

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

submission_date#

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

submitter_name#

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

submitter_email#

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

submitter_forward_username#

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

forge_type#

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

forge_url#

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

forge_contact_email#

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

forge_contact_name#

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

forge_contact_comment#

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

last_moderator#

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

last_modified_date#

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

property inbound_email_address: str#

Generate an email address for correspondence related to this request.

property forge_domain: str#

Get the domain/netloc out of the forge_url.

Fallback to using the first part of the url path, if the netloc can’t be found (for instance, if the url scheme hasn’t been set).

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

get_next_by_submission_date(*, field=<django.db.models.fields.DateTimeField: submission_date>, is_next=True, **kwargs)#
get_previous_by_submission_date(*, field=<django.db.models.fields.DateTimeField: submission_date>, is_next=False, **kwargs)#
get_status_display(*, field=<django.db.models.fields.TextField: status>)#
id#

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

objects = <django.db.models.manager.Manager object>#
requesthistory_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.