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