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.
浏览了文档,无法解决这个问题。
是否可以在 GAE 上使用 Python 中的字符串访问从数据存储中检索到的实体的属性?
类似employee.name 但employee.<>
如果我理解正确,你可以这样做:
getattr(MyModel, attrib_name)
这将检索属性attrib_name
attrib_name