How to break “for loop” in Django template

后端 未结 6 1862
甜味超标
甜味超标 2020-12-14 06:13

I have this code

    {% for account in object_list %}
        
        {% for field, value in book.get_fields %}
              {{ field.v         


        
6条回答
  •  鱼传尺愫
    2020-12-14 06:35

    There is no break in Django template system. Django template system is not programmed with python but with its own language.

    Depending on what you need to do, you might find this question useful. Otherwise, just put the one and only account you are trying to print on HTML on a special field on your RequestContext.

提交回复
热议问题