class IndexView(TemplateView):
template_name = "home.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['books'] = Books.objects.all()
return context
In the above code can anyone explain what is context['books']. I understand it is defined in the above line but I want to know how this syntax exactly works.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…