Skip to content

Commit

Permalink
add method for get all visible cards
Browse files Browse the repository at this point in the history
  • Loading branch information
otis22 committed Jun 26, 2019
1 parent d3a38f2 commit 96cf17a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_get_cards(self):
self.assertIsInstance(self._board.all_cards(), list)
self.assertIsInstance(self._board.open_cards(), list)
self.assertIsInstance(self._board.closed_cards(), list)
self.assertIsInstance(self._board.visible_cards(), list)

def test_fetch_action_limit(self):
card = self._add_card('For action limit testing')
Expand Down
12 changes: 12 additions & 0 deletions trello/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@ def closed_cards(self, custom_field_items='true'):
}
return self.get_cards(filters)

def visible_cards(self, custom_field_items='true'):
"""Returns all visible cards on this board
:rtype: list of Card
"""
filters = {
'filter': 'visible',
'fields': 'all',
'customFieldItems': custom_field_items
}
return self.get_cards(filters)

def get_cards(self, filters=None, card_filter=""):
"""
:filters: dict containing query parameters. Eg. {'fields': 'all'}
Expand Down

0 comments on commit 96cf17a

Please sign in to comment.