code: def is_valid_method(model, resource=None):
      
      validation_function_name = 'is_valid_{}'.format(
          request.method.lower())
      if hasattr(model, validation_function_name):
          return getattr(model, validation_function_name)(request, resource)
docs: Return the error message to be sent to the client if the current
      request passes fails any user-defined validation.