【发布时间】:2019-09-04 12:22:33
【问题描述】:
mydict = {"book1":["user1", "user2", "user3"],
"book2":["user1", "user4", "user5"],}
我想检查“user2 是否阅读 book1?”在模板中的 mydict 中,我执行以下操作:
{% if "user2" in mydict | get_item: "book1" %}
但是,我得到一个错误:
无法解析余数:'|'从'|'
我该如何解决?
【问题讨论】:
标签: python django dictionary templates