【发布时间】:2016-01-24 01:16:48
【问题描述】:
我正在构建一个网络应用程序,该应用程序使用其 API 向/从 Trello 推送数据。
当前堆栈是 pythonic,我使用py-trello 来管理大部分 API 调用。 但是有一个端点让我感到困惑:post a comment on a card
当前的py-trello 实现似乎没有提供发布新评论并立即检索其数据的方法。例如,您可以使用 List 来实现:
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 评论做同样的事情? 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
有什么线索吗?非常感谢!
【问题讨论】:
-
我知道这不是答案,但我喜欢您使用 trello 存储和接收数据的想法。我从来没有想过。感谢您提出这个想法。
-
由于这是特定于小型库的,您可能会在相应的 Github 页面上获得更好的答案github.com/sarumont/py-trello/issues
-
不过,如果有人用 Trello API 玩够了...并且有答案...我正在阅读
-
我正在阅读这似乎对我的下一个项目非常有用!
-
github上有任何答案吗??