DjangoRestMultipleModels
DjangoRestMultipleModels copied to clipboard
Receiving attribute error viewset has no attribute 'get_extra_actions'
When using the standardized format, I am getting the error that FileViewset has no attribute 'get_extra_actions'
I have tried routing the view using 'as_view' in the router.register function, but that only receives further issues. Viewset appears as:
`class FileViewset(ObjectMultipleModelAPIView): querylist = ( {'queryset': UploadedFile.objects.filter(id__in=list(EntryFile.objects.all().values_list('entry_id', flat=True))), 'serializer_class':FileSerializer}, {'queryset': FileLink.objects.all(), 'serializer_class':FileLinkSerializer} )
#for the router router.register(r'file', FileViewset, basename='files')
It looks like you accidental imported the View
from the library, rather than the Viewset
. You instead want:
from drf_multiple_model.viewsets import ObjectMultipleModelAPIViewSet