code: def results_decorator(func):
      
      # Wrap function to maintian the original doc string, etc
      @wraps(func)
      def decorator(lookup_cls):
          # Construct a class decorator from the original function
          original = lookup_cls.results
          def inner(self, request):
              # Wrap lookup_cls.results by first calling func and checking the result
              result = func(request)
              if isinstance(result, HttpResponse):
                  return result
              return original(self, request)
          # Replace original lookup_cls.results with wrapped version
          lookup_cls.results = inner
          return lookup_cls
      # Return the constructed decorator
      return decorator
docs: Helper for constructing simple decorators around Lookup.results.
  
      func is a function which takes a request as the first parameter. If func
      returns an HttpReponse it is returned otherwise the original Lookup.results
      is returned.