本文整理汇总了Python中appy.fields.Field.isCompleteValue方法的典型用法代码示例。如果您正苦于以下问题:Python Field.isCompleteValue方法的具体用法?Python Field.isCompleteValue怎么用?Python Field.isCompleteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appy.fields.Field
的用法示例。
在下文中一共展示了Field.isCompleteValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: isCompleteValue
# 需要导入模块: from appy.fields import Field [as 别名]
# 或者: from appy.fields.Field import isCompleteValue [as 别名]
def isCompleteValue(self, obj, value):
'''Returns True if the p_value must be considered as complete. For a
unilingual field, being complete simply means not being empty. For a
multilingual field, being complete means that a value is present for
every language.'''
if not self.isMultilingual(obj):
return Field.isCompleteValue(self, obj, value)
# As soon as a given language value is empty, the global value is not
# complete.
if not value: return True
for v in value.itervalues():
if Field.isEmptyValue(self, obj, v): return
return True