#34135: Add async interface to ManyRelatedManager & RelatedManager
-------------------------------------+-------------------------------------
     Reporter:  Jon Janzen           |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  async                |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Jon Janzen:

Old description:

> With #34112 and #33646 combined, there is now an async interface for
> reading/writing Models in a lot of cases. One of the obvious places where
> that isn't true is in `RelatedManager` instances. `RelatedManager`
> instances are missing async versions of:
>
> * `add`
> * `remove`
> * `clear`
> * `set`
>
> And this might be a separate ticket but the docs [1] are missing a
> reference to `acreate` which according to `dir()` exists on
> `ManyRelatedManager` (I assume as a consequence of inheriting from some
> superclass `Manager` type) but I didn't actually try and see if it works.
> I'm suspicious that it might not be fully correct as
> `related_descriptors.py` includes a possibly custom version of the
> synchronous `create` function (see [2] & [3]).
>
> [1]
> https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager
> [2]
> https://github.com/django/django/blob/main/django/db/models/fields/related_descriptors.py#L788-L792
> [3]
> https://github.com/django/django/blob/main/django/db/models/fields/related_descriptors.py#L1186-L1190

New description:

 With #34112 and #33646 combined, there is now an async interface for
 reading/writing Models in a lot of cases. One of the obvious places where
 that isn't true is in `RelatedManager` instances. `RelatedManager`
 instances are missing async versions of:

 * `add`
 * `remove`
 * `clear`
 * `set`

 And this might be a separate ticket but the docs (1) are missing a
 reference to `acreate` which according to `dir()` exists on
 `ManyRelatedManager` (I assume as a consequence of inheriting from some
 superclass `Manager` type) but I didn't actually try and see if it works.
 I'm suspicious that it might not be fully correct as
 `related_descriptors.py` includes a possibly custom version of the
 synchronous `create` function (see (2) & (3)).

 (1)
 
https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager
 (2)
 
https://github.com/django/django/blob/main/django/db/models/fields/related_descriptors.py#L788-L792
 (3)
 
https://github.com/django/django/blob/main/django/db/models/fields/related_descriptors.py#L1186-L1190

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34135#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701843a3db436-ee8f40f9-4da5-4eff-957c-465e565270b1-000000%40eu-central-1.amazonses.com.

Reply via email to