当前位置: 首页>>代码示例>>Python>>正文


Python Card.from_json方法代码示例

本文整理汇总了Python中card.Card.from_json方法的典型用法代码示例。如果您正苦于以下问题:Python Card.from_json方法的具体用法?Python Card.from_json怎么用?Python Card.from_json使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在card.Card的用法示例。


在下文中一共展示了Card.from_json方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_card

# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import from_json [as 别名]
    def add_card(self, name, desc=None):
        """Add a card to this list

        :name: name for the card
        :return: the card
        """
        json_obj = self.client.fetch_json(
            '/lists/' + self.id + '/cards',
            http_method='POST',
            post_args={'name': name, 'idList': self.id, 'desc': desc}, )
        return Card.from_json(self, json_obj)
开发者ID:gEndelf,项目名称:py-trello,代码行数:13,代码来源:trellolist.py

示例2: get_cards

# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import from_json [as 别名]
    def get_cards(self, filters=None):
        """
        :card_filter: filters on card status ('open', 'closed', 'all')
        :query_params: dict containing query parameters. Eg. {'fields': 'all'}

        More info on card queries:
        https://trello.com/docs/api/board/index.html#get-1-boards-board-id-cards
        """
        json_obj = self.client.fetch_json(
            '/boards/' + self.id + '/cards',
            query_params=filters
        )
        return list([Card.from_json(self, json) for json in json_obj])
开发者ID:gEndelf,项目名称:py-trello,代码行数:15,代码来源:board.py

示例3: list_cards

# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import from_json [as 别名]
 def list_cards(self):
     """Lists all cards in this list"""
     json_obj = self.client.fetch_json('/lists/' + self.id + '/cards')
     return [Card.from_json(self, c) for c in json_obj]
开发者ID:gEndelf,项目名称:py-trello,代码行数:6,代码来源:trellolist.py

示例4: get_card

# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import from_json [as 别名]
 def get_card(self, card_id):
     card_json = self.fetch_json('/cards/' + card_id)
     list_json = self.fetch_json('/lists/' + card_json['idList'])
     board = self.get_board(card_json['idBoard'])
     return Card.from_json(List.from_json(board, list_json), card_json)
开发者ID:gEndelf,项目名称:py-trello,代码行数:7,代码来源:trelloclient.py


注:本文中的card.Card.from_json方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。