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])
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)
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)