code: def wrap(self, func):
          
          @six.wraps(func)
          def wrapper(*args, **kwargs):
              try:
                  return self.aggregate()
              except KeyError:
                  return func(*args, **kwargs)
          return wrapper
docs: Wrap :func: to perform aggregation on :func: call.
  
          Should be called with view instance methods.