Exemplo n.º 1
0
    def rename_node(self, node, new_name):
        sql = ""
        db = Database()
        if node.is_it_dir:
            sql = "update folder set name=? where id=?"
        else:
            sql = "update project set name=? where id=?"

        db.run(sql, [new_name, node.id])
Exemplo n.º 2
0
    def rename_node(self, node, new_name):
        sql = ""
        db = Database()
        if node.is_it_dir:
            sql = "update folder set name=? where id=?"
        else:
            sql = "update project set name=? where id=?"

        db.run(sql, [new_name, node.id])
Exemplo n.º 3
0
    def add_node(self, node, parentId):
        sql = ""
        params = []
        db = Database()
        if node.is_it_dir:
            sql = "insert into folder(name,parent,userId) values(?,?,?)"
            params = [node.name, parentId, self.userId]
        else:
            sql = "insert into project(name,ownerId,folderId,dtFrom,dtTo)" " values(?,?,?,?,?)"
            params = [node.name, self.userId, parentId, node.extra_properties["dtFrom"], node.extra_properties["dtTo"]]

        db.run(sql, params)
Exemplo n.º 4
0
    def add_node(self, node, parentId):
        sql = ""
        params = []
        db = Database()
        if node.is_it_dir:
            sql = "insert into folder(name,parent,userId) values(?,?,?)"
            params = [node.name, parentId, self.userId]
        else:
            sql = "insert into project(name,ownerId,folderId,dtFrom,dtTo)" \
                  " values(?,?,?,?,?)"
            params = [
                node.name, self.userId, parentId,
                node.extra_properties["dtFrom"], node.extra_properties["dtTo"]
            ]

        db.run(sql, params)