以下是我的html代码,label里的for为什么报错了无效的id引用?
{%with id=widget.attrs.id%}SciView<div(s ifid%}id="f id}"ts endif%}{s ifwidget.attrs.class%}class="{{widget,attrs.class}}"{s endif{%for group,options,index inwidget.optgroups%}{%for optionin options%}<label(%ifoption.attrs.id%}for="{{option.attrs.id}"{%endif%}>{%include option.template_name withwidget=option%}</label>Database{%endfor%}{%endfor%}</div>{%s endwithI
错误
django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 5: 'id', expected 'empty' or 'endfor'. Did you forget to register or load this tag?