diff options
| author | DevilsAutumn <bhuvnesh875@gmail.com> | 2022-10-30 22:21:54 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-02 09:14:17 +0100 |
| commit | d5bcdf858d962d02de925603c17986980f03729a (patch) | |
| tree | 367182dbc54c46faa2196b7f047eceeda62ec650 /docs/topics | |
| parent | 6103059592c6c1bd171977d26b76ee475175043c (diff) | |
Fixed #34112 -- Added async-compatible interface to Model methods.
Thanks Adam Johnson for the review.
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/async.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/topics/async.txt b/docs/topics/async.txt index 9e2785c351..2b9b1a85d9 100644 --- a/docs/topics/async.txt +++ b/docs/topics/async.txt @@ -91,10 +91,20 @@ Detailed notes can be found in :ref:`async-queries`, but in short: * ``async for`` is supported on all QuerySets (including the output of ``values()`` and ``values_list()``.) +Django also supports some asynchronous model methods that use the database:: + + async def make_book(...): + book = Book(...) + await book.asave(using="secondary") + 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. + Performance ----------- |
