| Age | Commit message (Collapse) | Author |
|
Replaced bare `async for` over a not-locally-defined async iterable with
`async with (maybe_)aclosing(aiter(...)) as it: async for item in it:` at
every consumption site, so the iterator's aclose() runs deterministically
when the consumer exits — instead of being deferred to asyncio's asyncgen
finalizer hook.
Added django.utils.asyncio.maybe_aclosing as a small wrapper that uses
contextlib.aclosing when the iterator has aclose() and contextlib.nullcontext
otherwise (for caller-supplied iterators that may only implement __aiter__
and __anext__).
Sites:
- contrib/auth/backends.py:_aget_permissions (aclosing)
- core/paginator.py:AsyncPage.__aiter__ (maybe_aclosing)
- core/paginator.py:AsyncPage.aget_object_list (maybe_aclosing)
- db/models/query.py:QuerySet.aiterator (aclosing, hoisted across both
prefetch and no-prefetch branches)
- http/response.py:StreamingHttpResponse.streaming_content awrapper
(maybe_aclosing)
- http/response.py:StreamingHttpResponse.__iter__ to_list (maybe_aclosing)
- http/response.py:StreamingHttpResponse.__aiter__ (aclosing)
- shortcuts.py:aget_list_or_404 (aclosing)
- test/client.py:aclosing_iterator_wrapper (maybe_aclosing)
- utils/text.py:acompress_sequence (maybe_aclosing)
|
|
Per DEP 20, Django's version numbers are calendar-based from 2028, so
deprecation warning classes are now named after the calendar version
that removes the feature they mark, and the deprecation timeline is
headed by the same calendar version.
Updated references to RemovedInDjango71Warning to use the new warning,
and adjusted references to "Django 7.1" to "Django 2029".
|
|
assertIsInstance passes when the expected is a superclass of the
returned object.
Thanks James Bligh for the review!
|
|
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
As Python 3.12 is now the floor, we can drop the shims and
use the `inspect` module.
|
|
auth.alogin.
Per deprecation timeline.
|
|
Follow up to ceecd518b19044181a3598c55ebed7c2545963cc.
|
|
contrib.auth.aupdate_session_auth_hash().
|
|
|
|
|
|
Model.refresh_from_db()/arefresh_from_db().
The from_queryset parameter can be used to:
- use a custom Manager
- lock the row until the end of transaction
- select additional related objects
|
|
|
|
|
|
related methods test clients.
|
|
operation in QuerySet.update_or_create().
|
|
Thanks to Mariusz Felisiak for review.
|
|
|
|
methods for related managers.
Bug in 58b27e0dbb3d31ca1438790870b2b51ecdb10500.
|
|
|
|
Thanks Adam Johnson for the review.
|
|
As with the options() methods, wrap the response in a coroutine if
the view is async.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
|
|
Underlying issue was fixed in Python 3.8.1, now many versions ago.
https://bugs.python.org/issue38563
|
|
|
|
|
|
|
|
Case missed in a415ce70bef6d91036b00dd2c8544aed7aeeaaed.
|
|
variable.
|
|
Refs https://bugs.python.org/issue38563.
|
|
This adds an ASGI handler, asgi.py file for the default project layout,
a few async utilities and adds async-safety to many parts of Django.
|