本文整理汇总了Python中template.Template.list方法的典型用法代码示例。如果您正苦于以下问题:Python Template.list方法的具体用法?Python Template.list怎么用?Python Template.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template.Template
的用法示例。
在下文中一共展示了Template.list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list_templates
# 需要导入模块: from template import Template [as 别名]
# 或者: from template.Template import list [as 别名]
def list_templates(self, **kwargs):
"""
Retrieve list of existing templates created by owner of API-key
Optional parameters are translated into query-modifiers
Note that list() returns abbreviated form of templates. Use get() to retrieve full template.
API call used is v1/template/headers (GET)
@type pageSize: int
@param pageSize: Maximum length of list to return [Optional; Default = 10]
@type page: int
@param page: 1-based index of page into list, based on page_size [Optional; Default = 1]
@type order: string
@param order: Name of field on which to sort list [Optional; From (ID, Name, Created, Updated)]
@type direction: string
@param direction: Direction which to sort list [Optional; From (ASC, DESC)]
@return: List of template.Template instances
"""
temp_template = Template(api_client=self.api_client)
return temp_template.list(**kwargs)
示例2: template_list
# 需要导入模块: from template import Template [as 别名]
# 或者: from template.Template import list [as 别名]
def template_list():
templates = Template.list()
return success({"data": [x.json() for x in templates]})