Skip to content

Commit

Permalink
Add attachements to the card if present in the response JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
diegojromerolopez committed Mar 21, 2017
1 parent 89331cf commit ce2b291
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trello/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def from_json(cls, parent, json_obj):
card.idShort = json_obj['idShort']
card.labels = Label.from_json_list(card.board, json_obj['labels'])
card.dateLastActivity = dateparser.parse(json_obj['dateLastActivity'])
if "attachments" in json_obj:
card._attachments = []
for attachment_json in json_obj["attachments"]:
card._attachments.append(attachment_json)
return card

def __repr__(self):
Expand Down

0 comments on commit ce2b291

Please sign in to comment.