count number of rows in flask templates

前端 未结 2 1325
北海茫月
北海茫月 2020-12-31 04:12

i have send a variable from my views to templates which consist of the data from database

this is what i am using in my template

{% for i in data %}          


        
2条回答
  •  没有蜡笔的小新
    2020-12-31 05:08

    {{ data|length }}

    this works perfect we not need to use this in loop just use any where in the template even we dont need to send another variable from views

提交回复
热议问题