mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 03:20:12 +03:00
Merge b385f446dc
into c3175900bc
This commit is contained in:
commit
5acfefa1ac
|
@ -12,7 +12,7 @@ from rest_framework.views import APIView
|
|||
import types
|
||||
|
||||
|
||||
def api_view(http_method_names):
|
||||
def api_view(http_method_names, view_class=APIView):
|
||||
|
||||
"""
|
||||
Decorator that converts a function-based view into an APIView subclass.
|
||||
|
@ -23,7 +23,7 @@ def api_view(http_method_names):
|
|||
|
||||
WrappedAPIView = type(
|
||||
six.PY3 and 'WrappedAPIView' or b'WrappedAPIView',
|
||||
(APIView,),
|
||||
(view_class,),
|
||||
{'__doc__': func.__doc__}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user