Ejemplo n.º 1
0
def create_default_cards(board, user):
    user = user.data
    green = board.get_label_by_title(u'Green')
    red = board.get_label_by_title(u'Red')
    column_1 = board.columns[0]
    cards = [DataCard(title=u"Welcome to your board!", creation_date=datetime.utcnow()),
             DataCard(title=u"We've created some lists and cards for you, so you can play with it right now!", creation_date=datetime.utcnow()),
             DataCard(title=u"Use color-coded labels for organization",
                      labels=[green, red], creation_date=datetime.utcnow()),
             DataCard(title=u"Make as many lists as you need!",
                      votes=[DataVote(user=user)], creation_date=datetime.utcnow()),
             DataCard(title=u"Try dragging cards anywhere.", creation_date=datetime.utcnow()),
             DataCard(title=u"Finished with a card? Delete it.", creation_date=datetime.utcnow()),
             ]
    for i, c in enumerate(cards):
        c.index = i
    column_1.cards = cards
    column_1.nb_max_cards = len(cards)

    column_2 = board.columns[1]
    cards = [DataCard(title=u'This is a card.', creation_date=datetime.utcnow()),
             DataCard(title=u"Click on a card to see what's behind it.", creation_date=datetime.utcnow()),
             DataCard(title=u"You can add files to a card.", creation_date=datetime.utcnow()),
             DataCard(
                 title=u'To learn more tricks, check out the manual.', creation_date=datetime.utcnow()),
             DataCard(title=u"Use as many boards as you want.", creation_date=datetime.utcnow())]
    for i, c in enumerate(cards):
        c.index = i
    column_2.cards = cards
    column_2.nb_max_cards = len(cards) + 2
    session.refresh(board)
Ejemplo n.º 2
0
def create_default_cards(board, user):
    user = user.data
    green = board.get_label_by_title(u'Green')
    red = board.get_label_by_title(u'Red')
    column_1 = board.columns[0]
    cards = [DataCard(title=u"Welcome to your board!", creation_date=datetime.utcnow()),
             DataCard(title=u"We've created some lists and cards for you, so you can play with it right now!", creation_date=datetime.utcnow()),
             DataCard(title=u"Use color-coded labels for organization",
                      labels=[green, red], creation_date=datetime.utcnow()),
             DataCard(title=u"Make as many lists as you need!",
                      votes=[DataVote(user=user)], creation_date=datetime.utcnow()),
             DataCard(title=u"Try dragging cards anywhere.", creation_date=datetime.utcnow()),
             DataCard(title=u"Finished with a card? Delete it.", creation_date=datetime.utcnow()),
             ]
    for i, c in enumerate(cards):
        c.index = i
    column_1.cards = cards
    column_1.nb_max_cards = len(cards)

    column_2 = board.columns[1]
    cards = [DataCard(title=u'This is a card.', creation_date=datetime.utcnow()),
             DataCard(title=u"Click on a card to see what's behind it.", creation_date=datetime.utcnow()),
             DataCard(title=u"You can add files to a card.", creation_date=datetime.utcnow()),
             DataCard(
                 title=u'To learn more tricks, check out the manual.', creation_date=datetime.utcnow()),
             DataCard(title=u"Use as many boards as you want.", creation_date=datetime.utcnow())]
    for i, c in enumerate(cards):
        c.index = i
    column_2.cards = cards
    column_2.nb_max_cards = len(cards) + 2
    session.refresh(board)
Ejemplo n.º 3
0
    def delete(self):
        """Deletes the board.
           Children must be loaded.
        """
        assert (self.columns)  # at least, contains the archive
        for column in self.columns:
            column().delete(purge=True)
        self.data.delete_history()
        self.data.delete_members()
        session.refresh(self.data)
        self.data.delete()

        return True
Ejemplo n.º 4
0
    def delete(self):
        """Deletes the board.
           Children must be loaded.
        """
        assert(self.columns)  # at least, contains the archive
        for column in self.columns:
            column().delete(purge=True)
        self.data.delete_history()
        self.data.delete_members()
        session.refresh(self.data)
        self.data.delete()

        return True
Ejemplo n.º 5
0
 def delete(self):
     """Deletes the board
     """
     for column in self.columns:
         column().delete()
     self.data.delete_history()
     self.data.delete_members()
     session.refresh(self.data)
     self.data.delete()
     if self.on_board_delete is not None:
         # if self.on_board_delete is None there is nothing
         # to call after deletion
         self.on_board_delete()
     return True
Ejemplo n.º 6
0
 def delete(self):
     """Deletes the board
     """
     for column in self.columns:
         column().delete()
     self.data.delete_history()
     self.data.delete_members()
     session.refresh(self.data)
     self.data.delete()
     if self.on_board_delete is not None:
         # if self.on_board_delete is None there is nothing
         # to call after deletion
         self.on_board_delete()
     return True