code: def get_attr(self, name, default=None, fail_silently=True):
          
          try:
              return getattr(self, name)
          except KeyError:
              extra_context = getattr(self, "extra_context")
  
              if name in extra_context:
                  value = extra_context[name]
  
                  if callable(value):
                      return value(request=None)
  
              return default
docs: try extra context