如何使用变量访问对象的属性?我有这样的事情:
{% for inscrito in inscritos %}
{% for field in list_fields_inscrito %}
{{inscrito.field}} //here is the problem
{% endfor %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
例如 Inscrito 有: inscrito.id、inscrito.Name 和 inscrito.Adress,我只想打印 inscrito.id 和 inscrito.Name 因为 id 和 Name 在 list_fields_inscrito 中。
有人知道这是怎么做的吗?