本文整理汇总了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
)
示例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
)
示例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
)
示例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
)