本文整理匯總了Python中oyProjectManager.models.project.Project._condition_name方法的典型用法代碼示例。如果您正苦於以下問題:Python Project._condition_name方法的具體用法?Python Project._condition_name怎麽用?Python Project._condition_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類oyProjectManager.models.project.Project
的用法示例。
在下文中一共展示了Project._condition_name方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _validate_name
# 需要導入模塊: from oyProjectManager.models.project import Project [as 別名]
# 或者: from oyProjectManager.models.project.Project import _condition_name [as 別名]
def _validate_name(self, key, name):
"""validates the given name
"""
name = Project._condition_name(name)
return name
示例2: _condition_name
# 需要導入模塊: from oyProjectManager.models.project import Project [as 別名]
# 或者: from oyProjectManager.models.project.Project import _condition_name [as 別名]
def _condition_name(cls, name):
"""Formats the given name value
:param name: The name value to be conditioned
:return: str
"""
if name is None:
raise TypeError("The Sequence.name can not be None")
if not isinstance(name, (str, unicode)):
raise TypeError("Sequence.name should be an instance of string or "
"unicode not %s" % type(name))
if name is "":
raise ValueError("The Sequence.name can not be an empty string")
name = Project._condition_name(name)