add select_all

This commit is contained in:
collerek
2021-03-21 15:22:40 +01:00
parent 859ed5d1fc
commit 74beaa31b7
8 changed files with 182 additions and 36 deletions

View File

@ -1,3 +1,19 @@
# 0.10.0
## Breaking
* Dropped supported for long deprecated notation of field definition in which you use ormar fields as type hints i.e. `test_field: ormar.Integger() = None`
* Improved type hints -> `mypy` can properly resolve related models fields (`ForeignKey` and `ManyToMany`) as well as return types of `QuerySet` methods.
Those mentioned are now returning proper model (i.e. `Book`) instead or `ormar.Model` type. There is still problem with reverse sides of relation and `QuerysetProxy` methods,
to ease type hints now those return `Any`.
## Features
* add `select_all(follow: bool = False)` method to `QuerySet` and `QuerysetProxy`.
It is an equivalent of the Model's `load_all()` method but can be used directly in a query.
By default `select_all()` adds only directly related models, with `follow=True` also related models
of related models are added without loops in relations.
# 0.9.9
## Features