我需要在Django模板中输出对象,以便每个对象都有自己的模板。模板保存在变量“模板”中 - ['path/to/template1','path/to/template2',...]Django循环模板
有没有办法在对象循环中“循环”这些模板? ,不知何故:
{% for object in objects %}
{% cycle templates as template %}
{% include template %} // this code is just for example
{% endfor %}
我不能将这些模板直接包含到对象列表中,因为它是由paginator的模板标记生成的。
任何想法?谢谢。