我有以下代码:
employees = Employee.query()
employees = employees.filter(query.OR(Employee.passport_id == passport_id,
Employee.inn == inn))
employees.order(-Employee.added)
results = employees.fetch(5)
但我收到错误:
NameError: global name 'query' is not defined
顺便说一句,如果passport_id is None
和Employee.passport_id is None
. 它会找到这样的匹配吗?
更新。通过添加解决了第一个问题
from google.appengine.ext.ndb import query
第二个问题仍然存在..