Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表单集。我想提取集合中每个表单所代表的模型对象的 id。
这是因为我打算使用模板标签将这个 id 传递给一个函数并返回一个相关的对象。
我怎样才能做到这一点?
{% for each in model_formset %} {{each.instance.id}} {% endfor %}