How can reference the last item in a list in a Django template? {{ list.-1.key }}

后端 未结 6 1794
星月不相逢
星月不相逢 2021-01-01 08:33

if I have a variable in the context of unknown length, for example;
list=[{\'key\':\'A\'},{\'key\':\'B\'},{\'key\':\'C\'}]

How can I get the last ob

6条回答
提交回复
热议问题