Skip to main content

pypaginate.adapters.sqlalchemy.columns

Column resolution for the SQLAlchemy adapter.

Resolves a spec's field name to a mapped column attribute on a declarative model via getattr — the single source of column lookup shared by the filter, sort, and keyset translators.

resolve_column

def resolve_column(model: type, field: str) -> Any

Resolve field to a mapped column attribute on model.

Arguments:

  • model - A declarative ORM model class.
  • field - The attribute (column) name to resolve.

Returns:

The instrumented column attribute for WHERE / ORDER BY clauses.

Raises:

  • ConfigurationError - If field is not an attribute of model.