Skip to content

Commit

Permalink
add function create_label in card.py, which could create new label of…
Browse files Browse the repository at this point in the history
… the card by given name and color
  • Loading branch information
yguoogo committed Nov 8, 2017
1 parent 52ad3e0 commit 25c4e9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trello/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 25c4e9a

Please sign in to comment.