Entities¶
The models/entities subpackage contains SQLAlchemy ORM base entity classes that all domain entities in an ArchiPy
application should inherit from.
Base Entities¶
Base SQLAlchemy entity providing common columns (id, created_at, updated_at) and ORM configuration shared by all domain entities.
archipy.models.entities.sqlalchemy.base_entities.PK_COLUMN_NAME
module-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.BaseEntity ¶
Bases: DeclarativeBase
Base class for all SQLAlchemy models with automatic timestamps.
This class serves as the base for all entities in the application. It provides
common functionality such as automatic timestamping for created_at and
validation for the primary key column.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.BaseEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.EntityAttributeChecker ¶
Utility class for validating model attributes.
This class provides functionality to ensure that at least one of the specified attributes is present in a model.
Attributes:
| Name | Type | Description |
|---|---|---|
required_any |
list[list[str]]
|
A list of lists, where each inner list contains attribute names. At least one attribute from each inner list must be present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.EntityAttributeChecker.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.EntityAttributeChecker.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.DeletableMixin ¶
Mixin to add a deletable flag to models.
This mixin adds an is_deleted column to indicate whether the entity has been
soft-deleted, allowing for logical deletion without physically removing records.
Attributes:
| Name | Type | Description |
|---|---|---|
is_deleted |
Flag indicating if the entity is deleted. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.DeletableMixin.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableMixin ¶
Mixin to add updatable timestamp functionality.
This mixin adds an updated_at column to track the last update time of the entity,
automatically maintaining a timestamp of the most recent modification.
Attributes:
| Name | Type | Description |
|---|---|---|
updated_at |
Timestamp indicating when the entity was last updated. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableMixin.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableMixin ¶
Mixin to add Archivable functionality.
This mixin adds an is_archived column to indicate whether the entity has been
archived, and an origin_uuid column to reference the original entity.
Attributes:
| Name | Type | Description |
|---|---|---|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.AdminMixin ¶
Bases: EntityAttributeChecker
Mixin for models with admin-related attributes.
This mixin ensures that at least one of the admin-related attributes is present, providing tracking of which administrator created the entity.
Attributes:
| Name | Type | Description |
|---|---|---|
required_any |
list[list[str]]
|
Specifies the required admin-related attributes. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.AdminMixin.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.AdminMixin.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ManagerMixin ¶
Bases: EntityAttributeChecker
Mixin for models with manager-related attributes.
This mixin ensures that at least one of the manager-related attributes is present, providing tracking of which manager created the entity.
Attributes:
| Name | Type | Description |
|---|---|---|
required_any |
list[list[str]]
|
Specifies the required manager-related attributes. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ManagerMixin.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ManagerMixin.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminMixin ¶
Bases: EntityAttributeChecker
Mixin for models updatable by admin.
This mixin ensures that at least one of the admin-related update attributes is present, providing tracking of which administrator last updated the entity.
Attributes:
| Name | Type | Description |
|---|---|---|
required_any |
list[list[str]]
|
Specifies the required admin-related update attributes. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminMixin.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminMixin.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerMixin ¶
Bases: EntityAttributeChecker
Mixin for models updatable by managers.
This mixin ensures that at least one of the manager-related update attributes is present, providing tracking of which manager last updated the entity.
Attributes:
| Name | Type | Description |
|---|---|---|
required_any |
list[list[str]]
|
Specifies the required manager-related update attributes. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerMixin.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerMixin.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableEntity ¶
Bases: BaseEntity, UpdatableMixin
Base class for entities that support updating timestamps.
This class extends BaseEntity with update tracking functionality, allowing applications to track when records were last modified.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.DeletableEntity ¶
Bases: BaseEntity, DeletableMixin
Base class for entities that support soft deletion.
This class extends BaseEntity with soft deletion capability, allowing applications to mark records as deleted without physically removing them.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
is_deleted |
Flag indicating if the entity is deleted. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.AdminEntity ¶
Bases: BaseEntity, AdminMixin
Base class for entities with admin-related attributes.
This class extends BaseEntity with tracking of which administrator created the entity, supporting audit and accountability requirements.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
created_by_admin/created_by_admin_uuid |
Mapped[datetime]
|
Reference to the admin who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.AdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.AdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.AdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ManagerEntity ¶
Bases: BaseEntity, ManagerMixin
Base class for entities with manager-related attributes.
This class extends BaseEntity with tracking of which manager created the entity, supporting audit and accountability requirements.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
created_by/created_by_uuid |
Mapped[datetime]
|
Reference to the manager who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ManagerEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ManagerEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ManagerEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableEntity ¶
Bases: BaseEntity, UpdatableMixin, DeletableMixin
Base class for entities that support updating timestamps and soft deletion.
This class combines update tracking and soft deletion capabilities, providing a complete history of when records were created, updated, and deleted.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableEntity ¶
Bases: UpdatableEntity, ArchivableMixin
Base class for entities that support archiving.
This class extends UpdatableEntity with archiving capability, allowing applications to mark records as archived and track the original entity.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminEntity ¶
Bases: BaseEntity, UpdatableMixin, AdminMixin, UpdatableAdminMixin
Base class for entities updatable by admin with timestamps.
This class combines creation and update tracking for administrator actions, providing a comprehensive audit trail of administrative modifications.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
updated_by_admin/updated_by_admin_uuid |
Reference to the admin who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerEntity ¶
Bases: BaseEntity, UpdatableMixin, ManagerMixin, UpdatableManagerMixin
Base class for entities updatable by managers with timestamps.
This class combines creation and update tracking for manager actions, providing a comprehensive audit trail of management modifications.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
|
updated_by/updated_by_uuid |
Reference to the manager who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity ¶
Bases: UpdatableDeletableEntity, ArchivableMixin
Base class for entities that support both archiving and soft deletion.
This class combines archiving and soft deletion capabilities, providing a complete history of when records were created, updated, archived, and deleted.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity ¶
Bases: BaseEntity, UpdatableMixin, AdminMixin, UpdatableAdminMixin, DeletableMixin
Base class for entities updatable by admin with timestamps and soft deletion.
This class combines administrator creation and update tracking with soft deletion, providing a complete audit trail throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
updated_by_admin/updated_by_admin_uuid |
Reference to the admin who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity ¶
Bases: BaseEntity, UpdatableMixin, ManagerMixin, UpdatableManagerMixin, DeletableMixin
Base class for entities updatable by managers with timestamps and soft deletion.
This class combines manager creation and update tracking with soft deletion, providing a complete audit trail throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
|
updated_by/updated_by_uuid |
Reference to the manager who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity ¶
Bases: ArchivableEntity, AdminMixin
Base class for entities Archivable by admin.
This class extends ArchivableEntity with tracking of which administrator created the entity, supporting audit and accountability requirements.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity ¶
Bases: ArchivableEntity, ManagerMixin
Base class for entities Archivable by managers.
This class extends ArchivableEntity with tracking of which manager created the entity, supporting audit and accountability requirements.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerAdminEntity ¶
Bases: BaseEntity, UpdatableMixin, ManagerMixin, AdminMixin, UpdatableManagerMixin, UpdatableAdminMixin
Base class for entities updatable by both managers and admins with timestamps.
This class provides comprehensive tracking of entity creation and updates by both administrators and managers, supporting complex workflows where different user roles interact with the same data.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
|
updated_by_admin/updated_by_admin_uuid |
Reference to the admin who last updated the entity. |
|
updated_by/updated_by_uuid |
Reference to the manager who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableManagerAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity ¶
Bases: ArchivableEntity, ManagerMixin, AdminMixin
Base class for entities Archivable by both managers and admins.
This class provides comprehensive tracking of entity creation by both administrators and managers, supporting complex workflows where different user roles interact with the same data.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableManagerAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity ¶
Bases: ArchivableDeletableEntity, AdminMixin
Base class for entities Archivable and deletable by admin.
This class combines administrator creation tracking with soft deletion and archiving, providing a complete audit trail throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity ¶
Bases: ArchivableDeletableEntity, ManagerMixin
Base class for entities Archivable and deletable by managers.
This class combines manager creation tracking with soft deletion and archiving, providing a complete audit trail throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity ¶
Bases: BaseEntity, UpdatableMixin, ManagerMixin, AdminMixin, UpdatableManagerMixin, UpdatableAdminMixin, DeletableMixin
Base class for entities updatable by both managers and admins with timestamps and soft deletion.
This is the most comprehensive entity class, supporting tracking of creation and updates by both administrators and managers, along with soft deletion capability. It provides complete accountability for all operations throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
|
updated_by_admin/updated_by_admin_uuid |
Reference to the admin who last updated the entity. |
|
updated_by/updated_by_uuid |
Reference to the manager who last updated the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.UpdatableDeletableManagerAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity ¶
Bases: ArchivableDeletableEntity, ManagerMixin, AdminMixin
Base class for entities Archivable and deletable by both managers and admins.
This is a comprehensive entity class, supporting tracking of creation by both administrators and managers, along with soft deletion and archiving capability. It provides complete accountability for all operations throughout the entity's lifecycle.
Attributes:
| Name | Type | Description |
|---|---|---|
created_at |
Mapped[datetime]
|
Timestamp indicating when the entity was created. |
updated_at |
Timestamp indicating when the entity was last updated. |
|
is_deleted |
Flag indicating if the entity is deleted. |
|
is_archived |
Flag indicating if the entity is archived. |
|
origin_uuid |
Reference to the original entity. |
|
created_by_admin/created_by_admin_uuid |
Reference to the admin who created the entity. |
|
created_by/created_by_uuid |
Reference to the manager who created the entity. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.required_any
class-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.is_archived
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.origin_uuid
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.is_deleted
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.updated_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.created_at
class-attribute
instance-attribute
¶
archipy.models.entities.sqlalchemy.base_entities.ArchivableDeletableManagerAdminEntity.validate
classmethod
¶
Validate that at least one of the required attributes is present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_class
|
type
|
The class to validate. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If none of the required attributes are present. |
Source code in archipy/models/entities/sqlalchemy/base_entities.py
options: show_root_toc_entry: false heading_level: 3