Skip to content

User

User(id, created_at, updated_at, name, *, _orm_check=False)

Bases: ConstructableFromORM

Represents a user in the system.

Attributes:

Name Type Description
id int

The unique identifier for the user.

created_at datetime

The timestamp when the user was created.

updated_at datetime

The timestamp when the user was last updated.

name str

The name of the user.

Source code in svs_core/users/user.py
21
22
23
24
25
26
27
28
29
30
31
def __init__(
    self,
    id: int,
    created_at: datetime,
    updated_at: datetime,
    name: str,
    *,
    _orm_check: bool = False,
):
    super().__init__(id, created_at, updated_at, _orm_check=_orm_check)
    self.name = name

delete_self()

Deletes the user

Source code in svs_core/users/user.py
46
47
48
49
50
51
52
def delete_self(self) -> None:
    """Deletes the user"""

    from svs_core.db.client import DBClient

    DBClient.delete_user(self.id)
    DockerNetworkManager.delete_network(self.name)