Uid

class app.portfolio.util.uid.Uid[source]

Bases: object

Uid(namespace: str = ‘DEFAULT’, id: collections.abc.Hashable = <factory>)

Inheritance diagram of Uid

Inheritance Diagram for Uid

Methods

__init__([namespace, id])

as_tuple()

from_string(value)

from_value(value)

Attributes

namespace

id

entity

entity_or_none

id_as_str

Returns the ID as a string, suitable for display.

record

record_or_none

__init__(namespace: str = 'DEFAULT', id: ~collections.abc.Hashable = <factory>) None
Parameters:
Return type:

None

as_tuple() tuple[str, Hashable][source]
Return type:

tuple[str, Hashable]

property entity: Entity
property entity_or_none: Entity | None
classmethod from_string(value: str) Uid[source]
Parameters:

value (str)

Return type:

Uid

classmethod from_value(value: Any) Uid[source]
Parameters:

value (Any)

Return type:

Uid

id: Hashable
property id_as_str: str

Returns the ID as a string, suitable for display.

namespace: str
property record: EntityRecord
property record_or_none: EntityRecord | None