本文整理汇总了Python中ShotgunORM.mkEntityFieldString方法的典型用法代码示例。如果您正苦于以下问题:Python ShotgunORM.mkEntityFieldString方法的具体用法?Python ShotgunORM.mkEntityFieldString怎么用?Python ShotgunORM.mkEntityFieldString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShotgunORM
的用法示例。
在下文中一共展示了ShotgunORM.mkEntityFieldString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fromFieldData
# 需要导入模块: import ShotgunORM [as 别名]
# 或者: from ShotgunORM import mkEntityFieldString [as 别名]
def fromFieldData(self, sgData):
'''
Sets the fields value from data returned by a Shotgun query.
Returns True on success.
Args:
* (dict) sgData:
Dict of Shotgun formatted Entity field values.
'''
with self:
ShotgunORM.LoggerField.debug('%(sgField)s.fromFieldData()', {'sgField': self})
ShotgunORM.LoggerField.debug(' * sgData: %(sgData)s', {'sgData': sgData})
parent = self.parentEntity()
if not self.isEditable():
raise RuntimeError('%s is not editable!' % ShotgunORM.mkEntityFieldString(self))
if not ShotgunORM.config.DISABLE_FIELD_VALIDATE_ON_SET_VALUE:
self.validate(forReal=True)
result = self._fromFieldData(sgData)
if not result:
return False
self.setValid(True)
self.setHasCommit(True)
self.changed()
return True
示例2: setValue
# 需要导入模块: import ShotgunORM [as 别名]
# 或者: from ShotgunORM import mkEntityFieldString [as 别名]
def setValue(self, sgData):
'''
Set the value of the field.
Returns True on success.
Args:
* (object) sgData:
New field value.
'''
with self:
ShotgunORM.LoggerField.debug('%(sgField)s.setValue(...)', {'sgField': self})
ShotgunORM.LoggerField.debug(' * sgData: %(sgData)s', {'sgData': sgData})
if not self.isEditable():
raise RuntimeError('%s is not editable!' % ShotgunORM.mkEntityFieldString(self))
if not ShotgunORM.config.DISABLE_FIELD_VALIDATE_ON_SET_VALUE:
self.validate(forReal=True)
if sgData == None:
sgData = self.defaultValue()
updateResult = self._setValue(sgData)
if not updateResult:
if not self.isValid():
self.setValid(True)
return False
self.setValid(True)
self.setHasCommit(True)
self.changed()
return True
示例3: __repr__
# 需要导入模块: import ShotgunORM [as 别名]
# 或者: from ShotgunORM import mkEntityFieldString [as 别名]
def __repr__(self):
return '<%s>' % ShotgunORM.mkEntityFieldString(self)