开发者

Django templates crashes with no sense

Hello I'm trying to use google visualization API along with django templates system. I got an error that don't know how to fix. The error is the following:

 invalid_block_tag
    raise self.error(token开发者_JAVA技巧, "Invalid block tag: '%s'" % command)
django.template.TemplateSyntaxError: Invalid block tag: 'endfor'

The code is:

function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('date', 'time');
        data.addColumn('number', 'x');
        data.addColumn('number', 'y');
        data.addColumn('number', 'z');
        data.addRows([
        {% for d in datos &}
        [new Date({{d.instante|date:"Y, m, d, H, i, s"}}), {{d.x}}, {{d.y}}, {{d.z}}]
        {% if not forloop.last %},{% endif %}
        ]);
        {% endfor %}
        var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
        chart.draw(data, {displayAnnotations: true});
      }

Thanks you all!


You goofed your for tag:

{% for d in datos %}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜