I am new to DRF. I went through the example of filtering queryset at http://www.django-rest-framework.org/api-guide/filtering/#filtering-and-object-lookups
This link contains description about queryset filtering, as well as DjangoFilterBackend. As far as I am able to understand, they are serving the same purpose. But it's not clear when to use any one of them. In some of the cases, both queryset and filter_backends are used :-
class UserListView(generics.ListAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
filter_backends = (filters.OrderingFilter,)
ordering_fields = ('username', 'email')
Can anyone let me know, what's the difference between these two ?which one of these two have to be used, in which situations, we must prefer one over another ?
Thanks in advance