diff options
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 ----------- |
