From 20e3a9a006209f4cb6885887bd3c49bc65fc8514 Mon Sep 17 00:00:00 2001 From: sohopro Date: Thu, 2 Jun 2016 16:12:35 +0900 Subject: [PATCH] Update filtering.md --- docs/api-guide/filtering.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index a64913536..fcab15a79 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -105,7 +105,7 @@ using the `GenericAPIView` class based views. class UserListView(generics.ListAPIView): queryset = User.objects.all() - serializer = UserSerializer + serializer_class = UserSerializer filter_backends = (filters.DjangoFilterBackend,) ## Filtering and object lookups @@ -257,7 +257,7 @@ The `SearchFilter` class will only be applied if the view has a `search_fields` class UserListView(generics.ListAPIView): queryset = User.objects.all() - serializer = UserSerializer + serializer_class = UserSerializer filter_backends = (filters.SearchFilter,) search_fields = ('username', 'email') @@ -380,7 +380,7 @@ A complete example using both `DjangoObjectPermissionsFilter` and `DjangoObjectP 'change' or 'delete' permissions. """ queryset = Event.objects.all() - serializer = EventSerializer + serializer_class = EventSerializer filter_backends = (filters.DjangoObjectPermissionsFilter,) permission_classes = (myapp.permissions.CustomObjectPermissions,)