The custom function is a property of the class, which can be accessed via self:
class StokeBulkUpdate(generics.APIView):
def custom_function(self, list):
return list
def update(self, request,*args,**kwargs):
data = self.request.data
self.custom_function(data)
If you don't want to implicitly pass self to your method (like in your example), you need to use @staticmethod:
class StokeBulkUpdate(generics.APIView):
@staticmethod
def custom_function(list):
return list
def update(self, request,*args,**kwargs):
data = self.request.data
self.custom_function(data)