Set a view function's __module__ value to the WrappedAPIView object's __module__ (#4465)

This commit is contained in:
TakesxiSximada 2016-09-05 19:16:41 +09:00 committed by Tom Christie
parent 07efbdb45e
commit 5df54a711f

View File

@ -55,6 +55,7 @@ def api_view(http_method_names=None):
setattr(WrappedAPIView, method.lower(), handler) setattr(WrappedAPIView, method.lower(), handler)
WrappedAPIView.__name__ = func.__name__ WrappedAPIView.__name__ = func.__name__
WrappedAPIView.__module__ = func.__module__
WrappedAPIView.renderer_classes = getattr(func, 'renderer_classes', WrappedAPIView.renderer_classes = getattr(func, 'renderer_classes',
APIView.renderer_classes) APIView.renderer_classes)