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
In the end, I found out that everything didn’t work specifically because I had custom pagination in the drf settings. To fix everything, I needed to add: pagination_class = None. It would be convenient for new users to indicate in the documentation:
fromrest_framework.viewsetsimportReadOnlyModelViewSetfromdrf_excel.mixinsimportXLSXFileMixinfromdrf_excel.renderersimportXLSXRendererfrom .modelsimportMyExampleModelfrom .serializersimportMyExampleSerializerclassMyExampleViewSet(XLSXFileMixin, ReadOnlyModelViewSet):
queryset=MyExampleModel.objects.all()
serializer_class=MyExampleSerializerrenderer_classes= (XLSXRenderer,)
filename='my_export.xlsx'pagination_class=None# If you have a custom pagination class set in your settings
The text was updated successfully, but these errors were encountered:
I spent quite a lot of time to figure out why this library didn't work for me, here are my settings:
In the end, I found out that everything didn’t work specifically because I had custom pagination in the drf settings. To fix everything, I needed to add:
pagination_class = None
. It would be convenient for new users to indicate in the documentation:The text was updated successfully, but these errors were encountered: