reviewboard.hostingsvcs.models¶
Models for hosting service accounts.
- class HostingServiceAccount(id, service_name, hosting_url, username, data, visible, local_site)[source]¶
Bases:
Model
- 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>¶
- property service[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)[source]¶
Returns 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.
- is_mutable_by(user)[source]¶
Returns 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.
- accept_certificate(certificate)[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)¶