fix inherited pk and add field accessor access to relations

This commit is contained in:
collerek
2021-06-25 13:32:31 +02:00
parent cc76e9b862
commit 107404c3e8
10 changed files with 516 additions and 61 deletions

View File

@ -1,3 +1,23 @@
# 0.10.13
## ✨ Features
* Allow passing field accessors in `select_related` and `prefetch_related` aka. python style `select_related` [#225](https://github.com/collerek/ormar/issues/225).
* Previously:
```python
await Post.objects.select_related(["author", "categories"]).get()
await Author.objects.prefetch_related("posts__categories").get()
```
* Now also:
```python
await Post.objects.select_related([Post.author, Post.categories]).get()
await Author.objects.prefetch_related(Author.posts.categories).get()
```
## 🐛 Fixes
* Fix overwriting default value for inherited primary key [#253](https://github.com/collerek/ormar/issues/253)
# 0.10.12
## 🐛 Fixes