This is intentional, as it stands. Django 4.1 only added async QuerySet methods, not async Model methods. Async model methods like adelete(), and perhaps asave(), would be the next logical step.
On Fri, Oct 21, 2022 at 1:47 PM Jason Johns <jjohns98...@gmail.com> wrote: > I came across a reddit post yesterday > <https://www.reddit.com/r/django/comments/y7w5dm/django_async_delete_from_db/>about > `adelete` raising an attribute error > > r = await mymodel.objects.aget(some_name=myname) > await r.adelete() > > would throw an `AttributeError`, > > whereas r = await mymodel.objects.filter(some_name=myname).adelete() works > as expected. > > I was a little curious about this, and adelete > <https://docs.djangoproject.com/en/4.1/ref/models/querysets/#django.db.models.query.QuerySet.adelete> > is > explicitly called out in the queryset docs within the `delete` section. > but the models doc page > <https://docs.djangoproject.com/en/4.1/ref/models/instances/#deleting-objects>only > contains items about `delete`. Is this intentional or not, and if it is > intentional, perhaps a specific call-out in both queryset and model delete > sections would help with clarification. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/82ba40ef-ea73-4492-a2c3-448dbd1b9245n%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/82ba40ef-ea73-4492-a2c3-448dbd1b9245n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM3L6gz0i9dp7S5xsmE8%2B7GCeY1L5A0h%2BQKxGv7zs6pu9w%40mail.gmail.com.