In the simplified example below, how do I reference the context variable "Elephant" (created in the class Lion) from inside the class Leopard?
I have researched and tried a number of ways, including the last line below which results in a KeyError for "Elephant".
views.py
class Lion(ListView):
def get_context_data(self, **kwargs):
context super().get_context_data()
context[“Elephant”] = Rhinoceros
context["Giraffe"] = Eagle
return context
class Leopard(ListView):
Buffalo = Lion.get_context_data(context[“Elephant”])