diff options
| author | Jon Janzen <jon@jonjanzen.com> | 2022-11-03 19:57:33 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-09 10:32:40 +0100 |
| commit | 321ecb40f4da842926e1bc07e11df4aabe53ca4b (patch) | |
| tree | 3a306ec0bc38c90eb95d8adceaecc3017e1b3d06 /docs/topics | |
| parent | 41e8931c2cc68d8b2de4219be930e2c305b4eba1 (diff) | |
Fixed #34135 -- Added async-compatible interface to related managers.
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/async.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/topics/async.txt b/docs/topics/async.txt index 2b9b1a85d9..0570d59db2 100644 --- a/docs/topics/async.txt +++ b/docs/topics/async.txt @@ -97,13 +97,17 @@ Django also supports some asynchronous model methods that use the database:: book = Book(...) await book.asave(using="secondary") + async def make_book_with_tags(tags, ...): + book = await Book.objects.acreate(...) + await book.tags.aset(tags) + Transactions do not yet work in async mode. If you have a piece of code that needs transactions behavior, we recommend you write that piece as a single synchronous function and call it using :func:`sync_to_async`. .. versionchanged:: 4.2 - Asynchronous model interface was added. + Asynchronous model and related manager interfaces were added. Performance ----------- |
