当前位置: 首页>>代码示例>>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;未经允许,请勿转载。