Releases: tortoise/tortoise-orm
Releases · tortoise/tortoise-orm
0.16.16
v0.16.15
- Make
DateField
accept valid date str. - Add
QuerySet.select_for_update()
. - check
default
for notNone
on pydantic model creation - propagate default to pydantic model
- Add
QuerySet.select_related()
. - Add custom attribute name for Prefetch instruction.
- Add
db_constraint
forRelationalField
family.
v0.16.14
- We now do CI runs on a Windows VM as well, to try and prevent Windows specific regressions.
- Make
F
expression work withQuerySet.filter()
. - Include
py.typed
in source distribution. - Added
datetime
parsing fromint
forfields.DatetimeField
. get_or_create
passes theusing_db=
on if provided.- Allow custom
loop
andconnection_class
parameters to be passed on to asyncpg.
v0.16.13
- Default install of
tortoise-orm
now installs with no C-dependencies, if you want to use the C accelerators, please do apip install tortoise-orm[accel]
instead. - Added
<instance>.clone()
method that will create a cloned instance in memory. To persist it you still need to call.save()
.clone()
will raise aParamsError
if tortoise can't generate a primary key. In that case do a.clone(pk=<newval>)
- If manually setting the primary key value to
None
and the primary key can be automatically generated, this will create a new record. We however still recommend the.clone()
method instead. .save()
can be forced to do a create by settingforce_create=True
.save()
can be forced to do an update by settingforce_update=True
- Setting
update_fields
for a.save()
operation will strongly prefer to do an update if possible
v0.16.12
v0.16.11
- fix:
sqlite://:memory:
in Windows thrownOSError: [WinError 123]
- Support
bulk_create()
insertion of records with overridden primary key when the primary key is DB-generated - Add
queryset.exists()
andModel.exists()
. - Add model subscription lookup,
Model[<pkval>]
that will return the object or raiseKeyError
v0.16.10
v0.16.9
- Support
F
expression in.save()
now IntEnumField
accept valid int value andCharEnumField
accept valid str value- Pydantic models get created with globally unique identifier
- Leaf-detection to minimize duplicate Pydantic model creation
- Pydantic models with a Primary Key that is also a raw field of a relation is now not hidden when
exclude_raw_fields=True
as it is a critically important field - Raise an informative error when a field is set as nullable and primary key at the same time
- Foreign key id's are now described to have the positive-integer range of the field it is related to
- Fixed prefetching over OneToOne relations
- Fixed
__contains
for non-text fields (e.g.JSONB
)