code: def request_cached_property(func):
      
      @property
      @functools.wraps(func)
      def wrapped(self):
          cached_value = context.get_for_view(self, func.__name__, UNDEFINED)
          if cached_value is not UNDEFINED:
              return cached_value
  
          value = func(self)
          context.set_for_view(self, func.__name__, value)
  
          return value
  
      return wrapped
docs: Make the given method a per-request cached property.
  
      This caches the value on the request context rather than on the object
      itself, preventing problems if the object gets reused across multiple
      requests.