reviewboard.hostingsvcs.models¶
Models for hosting service accounts.
- class HostingServiceAccount(*args, **kwargs)[source]¶
Bases:
Model
An account for a hosting service.
- service_name[source]¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- hosting_url[source]¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- username[source]¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- data[source]¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- visible[source]¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- local_site[source]¶
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 aForwardManyToOneDescriptor
instance.
- objects: ClassVar[HostingServiceAccountManager] = <reviewboard.hostingsvcs.managers.HostingServiceAccountManager object>¶
- __str__() str [source]¶
Return a string representation of the hosting service account.
- Returns:
A string representation of the object.
- Return type:
- property service: BaseHostingService[source]¶
The hosting service associated with this account.
- Type:
reviewboard.hostingsvcs.base.hosting_service.BaseHostingService
- Raises:
reviewboard.hostingsvcs.errors.MissingHostingServiceError – The hosting service could not be loaded from the registry.
- is_accessible_by(user: User) bool [source]¶
Return whether or not the user has access to the account.
The account is accessible by the user if the user has access to the local site.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
True if the user has access to the hosting service account.
- Return type:
- is_mutable_by(user: User) bool [source]¶
Return whether or not the user can modify or delete the account.
The account is mutable by the user if the user is an administrator with proper permissions or the account is part of a LocalSite and the user has permissions to modify it.
- Parameters:
user (
django.contrib.auth.models.User
) – The user to check.- Returns:
True if the user can modify the hosting service account.
- Return type:
- accept_certificate(certificate: Certificate) None [source]¶
Accept the SSL certificate for the linked hosting URL.
- Parameters:
certificate (
reviewboard.scmtools.certs.Certificate
) – The certificate to accept.- Raises:
ValueError – The certificate data did not include required fields.
- __annotations__ = {'objects': 'ClassVar[HostingServiceAccountManager]'}¶
- get_data_json()¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- local_site_id¶
- repositories¶
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- set_data_json(json)¶