我如何重复使用<选项> HTML表格的数据? (django)(干)
我正在通过Django生成HTML响应,其中包括大量表单,其中一个字段之一是< select>
,其中许多(1,000+)< option> s。
由于重复每种形式的>
s,因此HTML响应非常长。我使用分页来减少每个响应中呈现的HTML量,但这对于特定应用程序并不是最佳的。
是否可以在HTML响应中呈现< option>
s并在每个表单字段中引用它而不会再次呈现?
I'm generating an HTML response via Django with a large set of forms, and one of the form fields is a <select>
with many (1,000+) <option>
s in the queryset.
Due to repeating the <option>
s for each form, the HTML response is egregiously long. I've used pagination to reduce the amount of HTML rendered in each response, but this isn't optimal for the particular application.
Is it possible to render the <option>
s once on the HTML response and reference it in each form field without rendering it again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论