有客自远方来52 2024-08-01 20:42 采纳率: 15.3%
浏览 4
已结题

为什么是无效的id引用?

以下是我的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?

  • 写回答

1条回答 默认 最新

  • 快ྂ乐ྂ至ྂ上ྂ 2024-08-01 22:34
    关注

    expected 'empty' or 'endfor' 期望是个空 或者外循环。

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 8月2日
  • 创建了问题 8月1日

悬赏问题

  • ¥15 35114 SVAC视频验签的问题
  • ¥15 impedancepy
  • ¥15 在虚拟机环境下完成以下,要求截图!
  • ¥15 求往届大挑得奖作品(ppt…)
  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图
  • ¥15 UE5.1局部变量对蓝图不可见