From aabe9be06cef056450e0d8508a3520081230ada7 Mon Sep 17 00:00:00 2001 From: Kenneth Feng Date: Sun, 4 May 2014 13:10:13 -0400 Subject: [PATCH] Fixed setting attributes on the 5 readonly @property member_ids, short_id, list_id, board_id, and description are readonly properties. Changed to direct access the underlying variables: - idMembers - idShort - idList - idBoard - desc --- trello/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/trello/__init__.py b/trello/__init__.py index 5260f78b..0238a4c1 100644 --- a/trello/__init__.py +++ b/trello/__init__.py @@ -409,10 +409,10 @@ def list_cards(self): cards = list() for c in json_obj: card = Card(self, c['id'], name=c['name'].encode('utf-8')) - card.description = c.get('desc', '').encode('utf-8') + card.desc = c.get('desc', '').encode('utf-8') card.closed = c['closed'] card.url = c['url'] - card.member_ids = c['idMembers'] + card.idMembers = c['idMembers'] cards.append(card) return cards @@ -428,10 +428,10 @@ def add_card(self, name, desc=None): post_args={'name': name, 'idList': self.id, 'desc': desc}, ) card = Card(self, json_obj['id']) card.name = json_obj['name'] - card.description = json_obj.get('desc', '') + card.desc = json_obj.get('desc', '') card.closed = json_obj['closed'] card.url = json_obj['url'] - card.member_ids = json_obj['idMembers'] + card.idMembers = json_obj['idMembers'] return card def fetch_actions(self, action_filter): @@ -503,13 +503,13 @@ def fetch(self): '/cards/' + self.id, query_params={'badges': False}) self.name = json_obj['name'].encode('utf-8') - self.description = json_obj.get('desc', '') + self.desc = json_obj.get('desc', '') self.closed = json_obj['closed'] self.url = json_obj['url'] - self.member_ids = json_obj['idMembers'] - self.short_id = json_obj['idShort'] - self.list_id = json_obj['idList'] - self.board_id = json_obj['idBoard'] + self.idMembers = json_obj['idMembers'] + self.idShort = json_obj['idShort'] + self.idList = json_obj['idList'] + self.idBoard = json_obj['idBoard'] self.labels = json_obj['labels'] self.badges = json_obj['badges'] self.due = json_obj['due'] @@ -547,7 +547,7 @@ def create_date(self): def set_description(self, description): self._set_remote_attribute('desc', description) - self.description = description + self.desc = description def set_due(self, due): """Set the due time for the card