def createEntity(self, sgEntityType, sgData):
    '''
    Creates a new Entity object of type sgEntityType.
    '''

    entityClass = self._classCache.get(sgEntityType, None)

    if entityClass == None:
      raise RuntimeError('unknown Entity type "%s"' % sgEntityType)

    sgData = ShotgunORM.beforeEntityCreate(self.connection(), sgEntityType, sgData)

    result = entityClass()

    result.buildFields()
    result._fromFieldData(sgData)

    return result
Example #2
0
  def createEntity(self, sgConnection, sgEntityType, sgData):
    '''
    Creates a new Entity object of type sgEntityType.
    '''

    entityClass = self._classCache.get(sgEntityType, None)

    if entityClass == None:
      raise RuntimeError('unknown Entity type "%s"' % sgEntityType)

    sgData = ShotgunORM.beforeEntityCreate(sgConnection, sgEntityType, sgData)

    result = entityClass(sgConnection)

    result.buildFields()
    result._fromFieldData(sgData)

    return result