2015-10-24 63 views
1

我正在構建一個Web應用程序,該應用程序使用其API將數據推送到/從Trello中提取。如何通過Trello API發佈和檢索評論卡數據?

當前堆棧是pythonic,我使用py-trello來管理大部分API調用。 但是有一個端點讓我困惑:post a comment on a card

看來目前的py-trello實現不提供發佈新評論並立即檢索其數據的方式。例如,您可以使用列表來執行此操作:

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) 

Trello API將創建的列表對象作爲JSON對象返回。 py-trello將此JSON變成List對象。

有沒有辦法與Card一樣評論?卡類帶有「添加評論」功能(code)。

但Trello似乎返回什麼...

>>> # Card definition 
>>> card = Card(parent=trello_board, card_id=id) 
>>> # Fetching card data 
>>> card.fetch() 
>>> # This is correctly pushed to Trello 
>>> obj = card.comment('Foo, bar!') 
>>> import pprint 
>>> # Hoping to print a big fat JSON 
>>> pp = pprint.PrettyPrinter(indent=4) 
>>> pp.pprint(obj) 
None 

任何線索?非常感謝 !

+0

我知道這不是答案,但我喜歡使用trello來存儲和接收數據的想法。我從來沒有想到這一點。感謝您提出這個想法。 –

+0

由於這是特定於一個小型圖書館,你可能會得到更好的答案在適當的Github頁面https://github.com/sarumont/py-trello/issues –

+0

我只是:) Thanx – TonyEight

回答

相關問題