我有如下的复杂NDB查询:
employees = Employee.query(query.OR(Employee.passport_id == passport_id,
Employee.inn == inn,
query.AND(Employee.last_name == last_name,
Employee.region == region,
Employee.prof_area == prof_area),
query.AND(Employee.last_name == last_name,
Employee.first_name == first_name,
Employee.date_of_birth == date_of_birth)
))
目前,当数据库值为None
且我的值为None
时,将返回此类实体。我怎么能避免这种情况?
我想我可以做(像每个领域):
if inn is None:
inn = 'something-I-do-not-expect-in-database'
但它看起来不太好。