Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
0.21.6
Fixed
- Fix bug in
pydantic_model_creatorwhen a foreign key is not included inincludeparam. (#1430) - Fix bug in
contrib.sanic.register_tortoisecausing a deadlock when using asyncpg and > 1 workers (#1696) - Open psycopg pool with
.open()to remove deprecated warning (#1697) - Fix bug in
bulk_updatewhen pk field is notid(#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)
0.21.5
0.21.4
Added
- Add ObjectDoesNotExistError to show better 404 message. (#759)
- DoesNotExist and MultipleObjectsReturned support 'Type[Model]' argument. (#742)(#1650)
- Add argument use_tz and timezone to RegisterTortoise. (#1649)
- Support await
tortoise.contrib.fastapi.RegisterTortoise. (#1662) - Add
tortoise.contrib.test.init_memory_sqlite. (#1657)
Fixed
- Fix
update_or_createerrors when field value changed. (#1584) - Fix bandit check error (#1643)
- Fix potential race condition in ConnectionWrapper (#1656)
- Fix py312 warning for datetime.utcnow (#1661)
- Fix reusing values and value_list queries (#780)
Changed
0.21.3
0.21.2
0.21.1
0.21.0
Added
- Enhancement for FastAPI lifespan support (#1371)
- Add
__eq__method toQto more easily test dynamically-built queries (#1506) - Added PlainToTsQuery function for postgres (#1347)
- Allow field's default keyword to be async function (#1498)
- Add support for queryset slicing. (#1341)
Fixed
- Fix
DatetimeFielduse '__year' report'int' object has no attribute 'utcoffset'. (#1575) - Fix
bulk_updatewhen using custom fields. (#1564) - Fix
optionalparameter inpydantic_model_creatordoes not work for pydantic v2. (#1551) - Fix
get_annotationsnow evaluates annotations in the default scope instead of the app namespace. (#1552) - Fix
get_or_createmethod. (#1404) - Use
index_nameinstead ofBaseSchemaGenerator._generate_index_nameto generate index name. - Use subquery for count() and exists() in
QuerySetto match count result toQuerySetresult. (#1607)
Changed
- Change
utils.chunkfrom function to return iterables lazily. - Removed lower bound of id keys in generated pydantic models. (#1602)
- Rename Field initial arguments
pk/indextoprimary_key/db_index. (#1621) - Renamed
Model.checkmethod toModel._checkto avoid naming collision issues (#1559) (#1550)
Breaking Changes
bulk_createnow does not return anything. (#1614)
0.20.1
Added
- Add binary compression support for
UUIDFieldinMySQL. (#1458) - Only
Model,Tortoise,BaseDBAsyncClient,__version__, andconnectionsare now exported fromtortoise - Add parameter
validatorstopydantic_model_creator. (#1471)
Fixed
- Fix order of fields in
ValuesListQuerywhen it has more than 10 fields. (#1492) - Fix pydantic v2 pydantic_model_creator nullable field not optional. (#1454)
- Fix pydantic v2.5 unittest error. (#1535)
- Fix pydantic_model_creator
exclude_readonlyparameter not working. - Fix annotation propagation for non-filter queries. (#1590)
0.20.0
Added
Fixed
- Fix foreign key constraint not generated on MSSQL Server. (#1400)
- Fix testcase error with python3.11 (#1308)
Breaking Changes
- Drop support for
pydantic1.x. - Drop support for
python3.7. - Param
config_classofpydantic_model_creatoris renamed tomodel_config. - Attr
config_classofPydanticMetais renamed tomodel_config.
0.19.3
Added
- Added config_class option to pydantic model genator that allows the developer to customize the generated pydantic model's
Configclass. (#1048)
Fixed
- Fastapi example test not working. (#1029)
- Fix create index sql error. (#1202)
- Fix dependencies resolve error. (#1246)
- Fix ignoring zero value of limit. (#1270)
- Fix ForeignKeyField is none when fk is integer 0. (#1274)
- Fix limit ignore zero. (#1270)
- Fix min/max value validators for decimal fields. (#1291)