From 25c4e9a5fe94d438435554812499121ed8036f7e Mon Sep 17 00:00:00 2001 From: gyu9 Date: Tue, 7 Nov 2017 22:16:27 -0500 Subject: [PATCH] add function create_label in card.py, which could create new label of the card by given name and color --- trello/card.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trello/card.py b/trello/card.py index 5f569633..8095a028 100644 --- a/trello/card.py +++ b/trello/card.py @@ -613,6 +613,12 @@ def add_label(self, label): http_method='POST', post_args={'value': label.id}) + def create_label(self, name, color): + self.client.fetch_json( + "/cards/" + self.id + "/labels", + http_method='POST', + post_args={"name": name, "color": color}) + def remove_label(self, label): self.client.fetch_json( '/cards/' + self.id + '/idLabels/' + label.id,