mafw.db.db_types

Database Type Definitions

This module provides type definitions for database models and related components.

It defines Protocol classes that represent the expected interfaces for database models, helping with static type checking when working with ORM frameworks like Peewee.

Classes

PeeweeModelWithMeta(*args, **kwargs)

Protocol defining the interface for Peewee model classes with metadata.

class mafw.db.db_types.PeeweeModelWithMeta(*args, **kwargs)[source]

Bases: Protocol

Protocol defining the interface for Peewee model classes with metadata.

This Protocol helps with static type checking for Peewee ORM models, ensuring that objects passed to functions expecting Peewee models have the necessary methods and attributes.

Attributes

_meta : Any

The metadata object associated with the Peewee model class. Contains information about the table, fields, and other model properties.

Methods

select(*args: Any, **kwargs: Any) -> Any

Select records from the database.

delete(*args: Any, **kwargs: Any) -> Any

Delete records from the database.