本文整理匯總了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