Skip to content

Commit

Permalink
Merge pull request #161 from diegojromerolopez/master
Browse files Browse the repository at this point in the history
Make easier the pagination of board actions
  • Loading branch information
sarumont authored Oct 15, 2016
2 parents 545e53f + a016130 commit d518400
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion trello/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,15 @@ def get_members(self, filters=None):

return members

def fetch_actions(self, action_filter, action_limit=50, since=None):
def fetch_actions(self, action_filter, action_limit=50, before=None, since=None):
query_params = {'filter': action_filter, 'limit': action_limit}

if since:
query_params["since"] = since

if before:
query_params["before"] = before

json_obj = self.client.fetch_json('/boards/' + self.id + '/actions', query_params=query_params)

self.actions = json_obj
Expand Down
3 changes: 2 additions & 1 deletion trello/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,11 @@ def subscribe(self):

def comment(self, comment_text):
"""Add a comment to a card."""
self.client.fetch_json(
comment_data = self.client.fetch_json(
'/cards/' + self.id + '/actions/comments',
http_method='POST',
post_args={'text': comment_text})
return comment_data

def add_label(self, label):
self.client.fetch_json(
Expand Down

0 comments on commit d518400

Please sign in to comment.