Tortoise-orm

Latest version: v0.24.2

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 26

0.22.1

------
Fixed
^^^^^
- Fix unable to use ManyToManyField if OneToOneField passed as Primary Key (1783)
- Fix sorting by Term (e.g. RawSQL) (1788)

Changed
^^^^^^^
- Parametrizes SELECT queries including `.count()`, `.exists()`, `.values()`, `.values_list()` (1777)

0.22

====

0.22.0

------
Fixed
^^^^^
- Fix enums not quoted, allowing using of str enums for filters (1776)
- Primary key field should not be nullable in pydantic schema (1778)
- Fix ambiguous column name when grouping with joining (1766)
- Fix same model returned by pydantic_model_creator calls with different arguments (1741)

Added
^^^^^
- JSONField adds optional generic support, and supports OpenAPI document generation by specifying `field_type` as a pydantic BaseModel (1763)
- Add table_name_generator attribute to Tortoise.init for dynamic table name generation (1770)
- Support for annotation and joins F() expressions (1761) (1765)
- Allow use of annotate fields within Case-When expression (1748)
- Added new queryset methods: last(), latest(), earliest() (1754) (1756)

Changed
^^^^^^^
- Change old pydantic docs link to new one (1775).
- Refactored pydantic_model_creator, interface not changed (1745)
- Values are no longer validated to be right type upon loading from database (1750)
- Refactored private field names in queryset classes (1751)

0.21.7

------
Fixed
^^^^^
- Fix unittest error with pydantic2.9 (1734)
- Fix bug when using annotate and count at the same time but the annotation does not match anything, leading to an IndexError (1707)
- Added missing field_type for TimeDeltaField (1462) (1699)
- improve jsonfield type hint (1700)
- Fix bug in tortoise.models.Model When a QuerySet uses the only function and then uses the print function to print the returned result, an AttributeError is generated (1724)
- Update the pylint plugin to latest astroid version (1708)

Added
^^^^^
- Add POSIX Regex support for PostgreSQL and MySQL (1714)
- support app=None for tortoise.contrib.fastapi.RegisterTortoise (1733)

0.21.6

------
Fixed
^^^^^
- Fix bug in `pydantic_model_creator` when a foreign key is not included in `include` param. (1430)
- Fix bug in `contrib.sanic.register_tortoise` causing a deadlock when using asyncpg and > 1 workers (1696)
- Open psycopg pool with `.open()` to remove deprecated warning (1697)
- Fix bug in `bulk_update` when pk field is not `id` (1698)
- Fix mysql uuid compression bug (1687)
- Fix comment for fk fields without constraint for mysql (1679)
- Removed no_delay option for postgres, as it wasn't doing anything (1677)
- Fix bug in `tortoise.models.Model` When a QuerySet uses the only function and then uses the print function to print the returned result, an AttributeError is generated. (1723)

0.21.5

------
Added
^^^^^
- Propagate `_create_db` parameter to RegisterTortoise. (1676)

Page 2 of 26

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.