def get_tems_by_author(authorId): teamsCursor = Database.find("teams", {"authorId": authorId}) return [team for team in teamsCursor]
def get_boards_by_author(cls, authorId): cursorBoards = Database.find('boards', {'authorId': authorId}) return [board for board in cursorBoards]
def get_for_board(boardId): ### check if boardId exist cursor = Database.find(Log.collection, {'boardId': boardId}) return [c for c in cursor]
def get_for_user(userId): ### check if userId exist cursor = Database.find(Log.collection, {'userId': userId}) return [c for c in cursor]
def get_comments_for_card(cardId): cursors = Database.find('comments', {'forCard': cardId}) return [c for c in cursors]
def get_all_lists_releted_to_board(cls, boardId): cursorLists = Database.find('lists', {"forBoard": boardId}) return [list for list in cursorLists], [cls(**list) for list in cursorLists]
def get_card_by_boardId(boardId): cursors = Database.find('cards', {'boardId': boardId}) return [c for c in cursors]