Changelog¶
v1.7.0¶
- Optional nested resources with automatic parent lookup, URL-managed foreign keys, scoped CRUD/restoration, and request-local parent context across all ORMs.
- Custom permission hooks, typed parent path parameters, and body schema support.
- Preserve physical deletion lifecycle/cascades and existing unscoped behavior.
- Fix required-field handling for virtual/backward Tortoise relations.
See Nested Resources.
Soft delete and restore (included in v1.7.0)¶
- Optional soft deletion with boolean or timestamp markers across SQLAlchemy (sync/async), Tortoise and Peewee.
- Automatic filtering for LIST/GET and 404s for ordinary writes to deleted rows.
- Restore endpoint with DELETE's OAuth2 protection and safe constraint conflicts.
- Existing viewsets retain physical deletion by default.
v1.3.0¶
- Declarative eager loading via
RelatedConfiginside Pydantic schemas. Addselect_related = [...]and/orprefetch_related = [...]to a schema's innerRelatedConfigclass, andBaseViewset/AsyncBaseViewsetautomatically appliesjoinedload/selectinload(SQLAlchemy) orprefetch_related(Tortoise) onLISTandGETendpoints. This eliminates N+1 queries without duplicating configuration between schemas and viewsets. - All adapter methods (
get_list_queryset,get_element_by_id, and their async counterparts) accept optionalselect_relatedandprefetch_relatedarguments for explicit overrides. - Full backward compatibility: new parameters default to
None; existing code works unchanged.
v1.2.2¶
- Documentation overhaul: added async + Pydantic v2 quickstart and override examples to README.
v1.2.1¶
- Hotfix:
SQLAlchemyAdapterno longer crashes at construction when the async DB-API driver (aiosqlite/asyncpg/aiomysql) is missing. Sync-only setups keep working out of the box;get_async_session()raises a helpfulRuntimeErrorlazily if you try to use async without the driver.
v1.2.0¶
- Pydantic v2 first: CRUD handlers use
model_dump(exclude_unset=...), fixing PATCH semantics that previously overwrote unset fields with defaults. - Lazy
db_conf: importing the package no longer creates SQLAlchemy engines unless they are needed, and works without async drivers installed. - Single source of truth for sync-to-async URL conversion and the default adapter singleton.
- Internal
register()deduplicated between sync and async viewsets via a shared mixin. - PEP 621
pyproject.toml,python_requires>=3.9, FastAPI>=0.110, ruff/black/mypy preconfigured.
v1.1.0¶
- Multi-ORM support via adapters (SQLAlchemy default, optional Tortoise and Peewee).
ORMFactoryand environment-drivenORM_TYPEconfiguration.