Skip to content

Commit

Permalink
Add list position attribute (pos) to list. This attribute is fetched …
Browse files Browse the repository at this point in the history
…by default when calling Board.get_lists
  • Loading branch information
Diego J. Romero López committed Aug 17, 2016
1 parent e0d7417 commit 3c8014b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trello/trellolist.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def __init__(self, board, list_id, name=''):
self.client = board.client
self.id = list_id
self.name = name
self.closed = None
self.pos = None

@classmethod
def from_json(cls, board, json_obj):
Expand All @@ -30,6 +32,7 @@ def from_json(cls, board, json_obj):
"""
list = List(board, json_obj['id'], name=json_obj['name'])
list.closed = json_obj['closed']
list.pos = json_obj['pos']
return list

def __repr__(self):
Expand All @@ -40,6 +43,7 @@ def fetch(self):
json_obj = self.client.fetch_json('/lists/' + self.id)
self.name = json_obj['name']
self.closed = json_obj['closed']
self.pos = json_obj['pos']

def list_cards(self, card_filter="open"):
"""Lists all cards in this list"""
Expand Down

0 comments on commit 3c8014b

Please sign in to comment.