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
This change was introduced in this commit: 4db3d6b, that solves an issue when multiple filter backends are used (total count was wrong).
IMHO, if your view is dealing with a ModelSerializer, you best option is to write a get_queryset() method, because even if we patch drf-datatables, I suspect other DRF third party apps will also assume that method exists anyway.
@izimobil My view is actually dealing with a normal Serializer because I'm not really displaying one particular model with my serializer. Anyways, I just implemented the same get_queryset() I found in GenericAPIView and I no longer get the error. Do you think this is ok for a trivial use case?
I have written my own ViewSet that extends
rest_framework.viewsets.ViewSet
Since the update to 0.5.0 a function I have written for this ViewSet crashes. I have the following function to make sure I get datatables filtering:
After the update to 0.5.0 the call to
filter_queryset()
errors out on the following line:total_count = view.get_queryset().count()
Due to the fact that my view does not have a
get_queryset()
method as can be seen here:Does this mean I now need to implement a
get_queryset()
method in my ViewSet? I am not sure I 100% understand this change. Thanks.The text was updated successfully, but these errors were encountered: