You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
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. Partially fixes #112.
Features
add select_all(follow: bool = False) method to QuerySet and QuerysetProxy.
It is kind of 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. Note that it's not and end async model
so you still have to issue get(), all() etc. as select_all() returns a QuerySet (or proxy)
like fields() or order_by(). #131
Internals
ormar fields are no longer stored as classes in Meta.model_fields dictionary
but instead they are stored as instances.