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