#36888: acreate method doesn't call asave
-------------------------------------+-------------------------------------
     Reporter:  Mateusz Szymanowski  |                    Owner:  Mateusz
                                     |  Szymanowski
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  6.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  acreate asave async  |             Triage Stage:
                                     |  Someday/Maybe
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * stage:  Accepted => Someday/Maybe

Comment:

 Before, `acreate()` had a `sync_to_async()` right off the bat:

 {{{#!py
      async def acreate(self, **kwargs):
         return await sync_to_async(self.create)(**kwargs)
 }}}

 Attempts in the PRs to remove that `sync_to_async()` stalled on the fact
 that `GenericForeignKeyDescriptor.__set__` accesses the database (see
 `generic_relations.tests.GenericRelationsTests.test_aadd`).

 If we're just shuffling around *where* the `sync_to_async` lies, then
 we're not accomplishing very much, as pointed out in the reviews. I
 [https://github.com/django/django/pull/20602#pullrequestreview-4391796527
 posted] a sketch of an async interface for Model instantiation.

 I think we need both that ''as well as'' an async implementation of
 `ContentType` methods (`aget_content_type()` etc.) before we can advance
 this.

 If someone can confirm the general direction, we can open separate tickets
 for those.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36888#comment:11>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019e75679842-085134ff-7fff-43ad-96f9-e59133307f51-000000%40eu-central-1.amazonses.com.

Reply via email to