當前位置: 首頁>>代碼示例>>Python>>正文


Python ShotgunORM.parseToLogicalOp方法代碼示例

本文整理匯總了Python中ShotgunORM.parseToLogicalOp方法的典型用法代碼示例。如果您正苦於以下問題:Python ShotgunORM.parseToLogicalOp方法的具體用法?Python ShotgunORM.parseToLogicalOp怎麽用?Python ShotgunORM.parseToLogicalOp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ShotgunORM的用法示例。


在下文中一共展示了ShotgunORM.parseToLogicalOp方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: searchIterator

# 需要導入模塊: import ShotgunORM [as 別名]
# 或者: from ShotgunORM import parseToLogicalOp [as 別名]
  def searchIterator(
    self,
    sgEntityType,
    sgSearchExp,
    sgFields=None,
    sgSearchArgs=[],
    order=None,
    filter_operator=None,
    limit=100,
    retired_only=False,
    page=1,
    include_archived_projects=True,
    additional_filter_presets=None,
    buffered=False
  ):
    '''
    Returns a SgSearchIterator which is used to iterate over the search filter
    by page.
    '''

    schema = self.schema()

    sgEntityType = schema.entityApiName(sgEntityType)

    sgFilters = ShotgunORM.parseToLogicalOp(
      schema.entityInfo(sgEntityType),
      sgSearchExp,
      sgSearchArgs
    )

    sgFilters = self._flattenFilters(sgFilters)

    iterClass = None

    if buffered:
      iterClass = ShotgunORM.SgBufferedSearchIterator
    else:
      iterClass = ShotgunORM.SgSearchIterator

    return iterClass(
      self,
      sgEntityType,
      sgFilters,
      sgFields,
      order,
      filter_operator,
      limit,
      retired_only,
      page,
      include_archived_projects,
      additional_filter_presets
    )
開發者ID:Kif11,項目名稱:python-shotgunorm,代碼行數:54,代碼來源:SgConnection.py

示例2: searchAsync

# 需要導入模塊: import ShotgunORM [as 別名]
# 或者: from ShotgunORM import parseToLogicalOp [as 別名]
  def searchAsync(
    self,
    sgEntityType,
    sgSearchExp,
    sgFields=None,
    sgSearchArgs=[],
    order=None,
    filter_operator=None,
    limit=100,
    retired_only=False,
    page=1,
    include_archived_projects=True,
    additional_filter_presets=None
  ):
    '''
    Performs an async search().

    See search() for a more detailed description.
    '''

    schema = self.schema()

    sgEntityType = schema.entityApiName(sgEntityType)

    sgFilters = ShotgunORM.parseToLogicalOp(
      schema.entityInfo(sgEntityType),
      sgSearchExp,
      sgSearchArgs
    )

    sgFilters = self._flattenFilters(sgFilters)

    return self.__asyncEngine.appendSearchToQueue(
      sgEntityType,
      sgFilters,
      sgFields,
      order,
      filter_operator,
      limit,
      retired_only,
      page,
      include_archived_projects,
      additional_filter_presets
    )
開發者ID:Kif11,項目名稱:python-shotgunorm,代碼行數:46,代碼來源:SgConnection.py

示例3: searchOneAsync

# 需要導入模塊: import ShotgunORM [as 別名]
# 或者: from ShotgunORM import parseToLogicalOp [as 別名]
  def searchOneAsync(
    self,
    sgEntityType,
    sgSearchExp,
    sgFields=None,
    sgSearchArgs=[],
    order=None,
    filter_operator=None,
    retired_only=False
  ):
    '''
    Performs an async searchOne().

    See searchOne() for a more detailed description.
    '''

    schema = self.schema()

    sgEntityType = schema.entityApiName(sgEntityType)

    sgFilters = ShotgunORM.parseToLogicalOp(
      schema.entityInfo(sgEntityType),
      sgSearchExp,
      sgSearchArgs
    )

    sgFilters = self._flattenFilters(sgFilters)

    return self.__asyncEngine.appendSearchToQueue(
      sgEntityType,
      sgFilters,
      sgFields,
      order,
      filter_operator,
      0,
      retired_only,
      0,
      isSingle=True
    )
開發者ID:YKdvd,項目名稱:python-shotgunorm,代碼行數:41,代碼來源:SgConnection.py

示例4: search

# 需要導入模塊: import ShotgunORM [as 別名]
# 或者: from ShotgunORM import parseToLogicalOp [as 別名]
  def search(self, sgEntityType, sgSearchExp, sgFields=None, sgSearchArgs=[], order=None, limit=0, retired_only=False, page=0):
    '''
    Uses a search string to find entities in Shotgun instead of a list.

    For more information on the search syntax check the ShotgunORM documentation.

    Args:
      * (str) sgEntityType:
        Entity type to find.

      * (str) sgSearchExp:
        Search expression string.

      * (list) sgFields:
        Fields that return results will have filled in with data from Shotgun.

      * (list) sgSearchArgs:
        Args used by the search expression string during evaluation.

      * (list) order:
        List of Shotgun formatted order filters.

      * (int) limit:
        Limits the amount of Entities can be returned.

      * (bool) retired_only:
        Return only retired entities.

      * (int) page:
        Return a single specified page number of records instead of the entire
        result set.
    '''

    schema = self.schema()

    sgconnection = self.connection()

    entity_type = schema.entityApiName(sgEntityType)

    ShotgunORM.LoggerConnection.debug('%(sgConnection)s.search(...)', {'sgConnection': self})
    ShotgunORM.LoggerConnection.debug('    * entity_type: %(entityType)s', {'entityType': entity_type})
    ShotgunORM.LoggerConnection.debug('    * search_exp: "%(sgSearchExp)s"', {'sgSearchExp': sgSearchExp})
    ShotgunORM.LoggerConnection.debug('    * fields: %(sgFields)s', {'sgFields': sgFields})

    filters = ShotgunORM.parseToLogicalOp(
      schema.entityInfo(entity_type),
      sgSearchExp,
      sgSearchArgs
    )

    filters = self._flattenFilters(filters)

    if sgFields == None:
      sgFields = self.defaultEntityQueryFields(entity_type)
    else:
      if isinstance(sgFields, str):
        sgFields = [sgFields]

      sgFields = set(sgFields)

      if 'default' in sgFields:
        sgFields.discard('default')

        sgFields.update(self.defaultEntityQueryFields(entity_type))

    return self.find(
      entity_type,
      filters,
      sgFields,
      order=order,
      limit=limit,
      retired_only=retired_only,
      page=page
    )
開發者ID:AndrejAleksic,項目名稱:python-shotgunorm,代碼行數:76,代碼來源:SgConnection.py


注:本文中的ShotgunORM.parseToLogicalOp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。