mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Merge bf96081663
into c3175900bc
This commit is contained in:
commit
101ff39c5c
|
@ -306,7 +306,7 @@ class APIView(View):
|
|||
negotiator=self.get_content_negotiator(),
|
||||
parser_context=parser_context)
|
||||
|
||||
def initial(self, request, *args, **kwargs):
|
||||
def initialize(self, request, *args, **kwargs):
|
||||
"""
|
||||
Runs anything that needs to occur prior to calling the method handler.
|
||||
"""
|
||||
|
@ -321,6 +321,11 @@ class APIView(View):
|
|||
neg = self.perform_content_negotiation(request)
|
||||
request.accepted_renderer, request.accepted_media_type = neg
|
||||
|
||||
def initial(self, request, *args, **kwargs):
|
||||
raise DeprecationWarning("Call to deprecated method APIView.initial()."
|
||||
" Please use APIView.initialize() instead.")
|
||||
return self.initialize(request, *args, **kwargs)
|
||||
|
||||
def finalize_response(self, request, response, *args, **kwargs):
|
||||
"""
|
||||
Returns the final response object.
|
||||
|
@ -384,7 +389,7 @@ class APIView(View):
|
|||
self.headers = self.default_response_headers # deprecate?
|
||||
|
||||
try:
|
||||
self.initial(request, *args, **kwargs)
|
||||
self.initialize(request, *args, **kwargs)
|
||||
|
||||
# Get the appropriate handler method
|
||||
if request.method.lower() in self.http_method_names:
|
||||
|
|
Loading…
Reference in New Issue
Block a user