From 321ecb40f4da842926e1bc07e11df4aabe53ca4b Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Thu, 3 Nov 2022 19:57:33 +0100 Subject: Fixed #34135 -- Added async-compatible interface to related managers. --- docs/topics/async.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/topics') 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 ----------- -- cgit v1.3