Version 0.18.0
Added
- ComputedField.
- Permission template.
reverse_clean
for ForeignKeys.- Expanded filter methods of querysets (can pass now dict and querysets).
- Properly scoped
with_tenant
andwith_schema
.
Changed
- Managers use now instance attributes (database, schema).
- Expose
as_select
instead ofraw_query
. model_fields
contain now the fields so we can actually use the pydantic magic.- BREAKING: deprecate
set_tenant
and remove manager hack. This way the tenant scope could leak. Usewith_tenant
instead.
Fixed
select_related
works across ManyToMany fields.select_related
couldn't handle multiple pathes to the same table.select_related
would remove valid model instances because of non-existent related objects.- Fix identifying clashing column names in joins, so every model gets its right parameters.
- Dependency tracking for join, so it doesn't depend on the order of
select_related
. select_related
entries work in any order and don't overwrite each other.
-only
anddefer
work onselect_related
.- Autogenerated
id
wasn't added in model_dump. - Tenants worked only till the first query.
Breaking changes (upgrade path)
set_tenant("foo")
Becomes now
with with_tenant("foo"):
...
activate_schema("foo")
...
deactivate_schema()
Becomes now
with with_schema("foo"):
...