Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用过滤器获取列表中的项目,然后获取其字段,如下所示:
{% if (trees|lookup:subtree_num).task_count %}
没有直接的方法,试试这个:
{%for data in trees %} {% if forloop.counter == subtree_num %} {{ data.task_count }} {% endif %} {% endfor %}