本文整理匯總了Python中models.board.Board.add方法的典型用法代碼示例。如果您正苦於以下問題:Python Board.add方法的具體用法?Python Board.add怎麽用?Python Board.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.board.Board
的用法示例。
在下文中一共展示了Board.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_lists_by_board_id
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_lists_by_board_id(self):
bid0 = Board.add("board1", "A")
bid1 = Board.add("board2", "A")
lid0 = List.add("List0", bid0)
list0 = List.get(lid0)
lid1 = List.add("List1", bid1)
list1 = List.get(lid1)
assert lid0 in [_list.id for _list in List.get_lists_by_board_id(bid0)]
assert lid1 not in [_list.id for _list in List.get_lists_by_board_id(bid0)]
示例2: test_add_and_get_lists
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get_lists(self):
bid0 = Board.add("board0", "A")
board0 = Board.get(bid0)
bid1 = Board.add("board1", "A")
lid0 = List.add("list0", bid0)
lid1 = List.add("list1", bid1)
assert lid0 in [_list.id for _list in board0.get_lists()]
assert lid1 not in [_list.id for _list in board0.get_lists()]
示例3: test_add_and_get_boards
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get_boards(self):
cid = User.add("test_user1", "password", "[email protected]")
user = User.get(cid)
bid0 = Board.add("board1", "A")
bid1 = Board.add("board2", "A")
board0 = Board.get(bid0)
board1 = Board.get(bid1)
user.add_board(board0)
assert str(bid0) in user.get_board_ids()
assert str(bid1) not in user.get_board_ids()
示例4: test_get_user_ids
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_user_ids(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
card_id = Card.add("card0", lid0, uid0)
card = Card.get(card_id)
assert str(uid0) in [user_id for user_id in card.get_user_ids()]
示例5: test_get_cards_by_list_id
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_cards_by_list_id(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
card_id = Card.add("card0", lid0, uid0)
card = Card.get(card_id)
assert card_id in [card.id for card in Card.get_cards_by_list_id(lid0)]
示例6: test_get_comments_by_card_id
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_comments_by_card_id(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
bid1 = Board.add("board2", "A")
aid0 = Activity.add(bid0, uid0, "BLABLA")
aid1 = Activity.add(bid0, uid0, "LA")
aid2 = Activity.add(bid1, uid0, "HULA")
activity0 = Activity.get(aid0)
activity1 = Activity.get(aid1)
activity2 = Activity.get(aid2)
assert aid0 in [activity.id for activity in Activity.get_all(bid0)]
assert aid1 in [activity.id for activity in Activity.get_all(bid0)]
assert aid2 not in [activity.id for activity in Activity.get_all(bid0)]
assert aid2 in [activity.id for activity in Activity.get_all(bid1)]
示例7: test_set_and_get_card
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_set_and_get_card(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
card_id = Card.add("card0", lid0, uid0)
card = Card.get(card_id)
assert card.title == 'card0'
assert card.list_id == lid0
示例8: test_get_and_test_description
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_and_test_description(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
card_id = Card.add("card0", lid0, uid0)
card = Card.get(card_id)
card.set_description('desc')
assert 'desc' in card.get_description()
示例9: test_add_and_get
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
aid0 = Activity.add(bid0, uid0, "BLABLA")
activity0 = Activity.get(aid0)
assert bid0 == activity0.board_id
assert uid0 == activity0.user_id
assert "BLABLA" == activity0.content
示例10: test_add_and_get
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
caid0 = Card.add("card1", lid0, uid0)
coid0 = Comment.add(caid0, uid0, "comment1")
comment0 = Comment.get(coid0)
assert caid0 == comment0.card_id
assert uid0 == comment0.user_id
assert "comment1" == comment0.content
示例11: test_add_and_get_users
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get_users(self):
bid0 = Board.add("board0", "A")
board0 = Board.get(bid0)
uid0 = User.add("test1", "password", "[email protected]")
user0 = User.get(uid0)
uid1 = User.add("test2", "password", "[email protected]")
user1 = User.get(uid0)
board0.add_user(user0)
assert str(uid0) in board0.get_user_ids()
assert str(uid1) not in board0.get_user_ids()
示例12: incr_decr_get_comment
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def incr_decr_get_comment(self):
uid0 = User.add("test1", "password", "[email protected]")
bid0 = Board.add("board1", "A")
lid0 = List.add("To Do", bid0)
card_id = Card.add("card0", lid0, uid0)
card = Card.get(card_id)
Card.incr_comment(card_id)
assert 1 == card.get_comment_count()
Card.desc_comment(card_id)
assert 0 == card.get_comment_count()
示例13: test_get_cards
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_get_cards(self):
bid0 = Board.add("board1", "A")
lid0 = List.add("List0", bid0)
list0 = List.get(lid0)
lid1 = List.add("List1", bid0)
list1 = List.get(lid1)
uid0 = User.add("test1", "password", "[email protected]")
caid0 = Card.add("card1", lid0, uid0)
caid1 = Card.add("card2", lid1, uid0)
assert caid0 in [card.id for card in list0.get_cards()]
assert caid1 not in [card.id for card in list0.get_cards()]
示例14: api_board
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def api_board(board_id=None):
print "=======", request.form
try:
title = request.form['title']
except:
return jsonify({'code':400, 'message':'Invalid Request'})
board_id = Board.add(title,'A')
board = Board.get(board_id)
board.add_user(current_user)
current_user.add_board(board)
List.add("To Do", board_id)
List.add("Doing", board_id)
List.add("Done", board_id)
return jsonify({'board_id':board_id})
示例15: test_add_and_get_cards
# 需要導入模塊: from models.board import Board [as 別名]
# 或者: from models.board.Board import add [as 別名]
def test_add_and_get_cards(self):
uid0 = User.add("test_user1", "password", "[email protected]")
user0 = User.get(uid0)
uid1 = User.add("test_user2", "password", "[email protected]")
user1 = User.get(uid1)
bid0 = Board.add("board1", "A")
lid0 = List.add("List0", bid0)
caid0 = Card.add("card1", lid0, uid0)
caid1 = Card.add("card2", lid0, uid1)
card0 = Card.get(caid0)
print caid0, user0.get_card_ids()
assert str(caid0) in user0.get_card_ids()
assert str(caid1) not in user0.get_card_ids()