def get_list(self, list_id): """Get list :rtype: List """ obj = self.client.fetch_json('/lists/' + list_id) return List.from_json(board=self, json_obj=obj)
def get_list(self, list_id): """Get list :rtype: List """ list_json = self.fetch_json('/lists/' + list_id) board = self.get_board(list_json['idBoard']) return List.from_json(board, list_json)
def get_card(self, card_id): '''Get card :rtype: Card ''' 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)
def get_card(self, card_id): """Get card :rtype: Card """ 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)
def get_card(self, card_id): """Get card :rtype: Card """ card_json = self.fetch_json('/cards/' + card_id, query_params={'customFieldItems': 'true'}) 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)
def get_lists(self, list_filter): """Get lists from filter :rtype: list of List """ # error checking json_obj = self.client.fetch_json( '/boards/' + self.id + '/lists', query_params={'cards': 'none', 'filter': list_filter}) return [List.from_json(board=self, json_obj=obj) for obj in json_obj]
def add_list(self, name): """Add a list to this board :name: name for the list :return: the list :rtype: List """ obj = self.client.fetch_json( '/lists', http_method='POST', post_args={'name': name, 'idBoard': self.id}, ) return List.from_json(board=self, json_obj=obj)
def add_list(self, name, pos=None): """Add a list to this board :name: name for the list :pos: position of the list: "bottom", "top" or a positive number :return: the list :rtype: List """ arguments = {'name': name, 'idBoard': self.id} if pos: arguments["pos"] = pos obj = self.client.fetch_json( '/lists', http_method='POST', post_args=arguments, ) return List.from_json(board=self, json_obj=obj)