You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from django_async_extensions.aviews.generic import AsyncListView
7
+
8
+
classMyListView(AsyncListView):
9
+
model = MyModel
10
+
```
11
+
12
+
`AsyncListView` works similarly to django's [ListView](https://docs.djangoproject.com/en/5.1/ref/class-based-views/generic-display/#listview) but with a few differences:
13
+
14
+
1.`get_queryset()` method is async.
15
+
2.`paginate_queryset()` method is async.
16
+
3.`get_context_data()` method is async.
17
+
4.`get()` method is async.
18
+
5.[AsyncPaginator](../../core/async-paginator.md) is used for pagination instead of django's regular [Paginator](https://docs.djangoproject.com/en/5.1/ref/paginator/#django.core.paginator.Paginator).
19
+
6.`AsyncListView` inherits from [AsyncView](async-class-based-views.md#asyncview) so anything mentioned there also applies here.
20
+
21
+
## Base classes
22
+
some of the base classes for `ListView` have been re-written as async:
23
+
24
+
### AsyncMultipleObjectMixin
25
+
like [MultipleObjectMixin](https://docs.djangoproject.com/en/5.1/ref/class-based-views/mixins-multiple-object/#django.views.generic.list.MultipleObjectMixin) but `get_queryset()`, `paginate_queryset()` and `get_context_data()` methods are async.
26
+
27
+
### AsyncBaseListView
28
+
like [BaseListView](https://docs.djangoproject.com/en/5.1/ref/class-based-views/generic-display/#django.views.generic.list.BaseListView) but `get()` method is async.
0 commit comments