Skip to content

Commit

Permalink
Merge pull request #219 from t0ffel/master
Browse files Browse the repository at this point in the history
Fixed fetch_actions for individual cards.
  • Loading branch information
sarumont authored Sep 7, 2017
2 parents 88a4eca + 6b818c6 commit 52ad3e0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions trello/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,22 @@ def fetch_attachments(self, force=False):
def get_attachments(self):
return [Attachments.from_json(attachments_json) for attachments_json in self.fetch_attachments(force=True)]

def fetch_actions(self, action_filter='createCard', since=None, before=None):
def fetch_actions(self, action_filter='createCard', since=None, before=None, action_limit=50):
"""
Fetch actions for this card can give more argv to action_filter,
split for ',' json_obj is list
"""
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(
'/cards/' + self.id + '/actions',
query_params={'filter': action_filter,
"since": since,
"before": before})
query_params=query_params)

self.actions = json_obj
return self.actions

Expand Down

0 comments on commit 52ad3e0

Please sign in to comment.