def ignoreValue(ignoreEmptyField,
fieldValue):
"""
Evaluate the value of a field and indicate whether to ignore it or not.
Internal function.
ignoreEmptyField: If set to 1 indicates that the field should be
ignored if it is an empty string (integer/0|1).
fieldValue: Value of field (string).
Returns: 1 if field should be ignored, otherwise 0
(integer/0|1).
"""
if (type(fieldValue) == types.IntType):
if (ignoreEmptyField and (fieldValue == -1)): return 1
elif (ignoreEmptyField and (str(fieldValue).strip() == "")):
return 1
return 0
评论列表
文章目录