app.models.base moduleΒΆ

SQLAlchemy declarative base and shared mixins.

class app.models.base.Base(**kwargs: Any)[source]ΒΆ

Bases: DeclarativeBase

metadata: ClassVar[MetaData] = MetaData()ΒΆ

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

registry: ClassVar[registry] = <sqlalchemy.orm.decl_api.registry object>ΒΆ

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class app.models.base.TimestampMixin[source]ΒΆ

Bases: object

Adds created_at and updated_at to any model.

created_at: Mapped[datetime] = <sqlalchemy.orm.properties.MappedColumn object>ΒΆ
updated_at: Mapped[datetime] = <sqlalchemy.orm.properties.MappedColumn object>ΒΆ
class app.models.base.UUIDPrimaryKeyMixin[source]ΒΆ

Bases: object

UUID primary key using PostgreSQL gen_random_uuid().

id: Mapped[UUID] = <sqlalchemy.orm.properties.MappedColumn object>ΒΆ