def updateNode(node): if node['type'] == 'module': node['url'] = 'http://www.voer.edu.vn/m/' + node['id'] node['license'] = "http://creativecommons.org/licenses/by/3.0/" # prepare authors mrid = models.getMaterialRawID(node['id'], node['version']) persons = models.getMaterialPersons(mrid) author_ids = persons['author'].split(',') authors = models.getPersonName(author_ids) if isinstance(authors, str): authors = [authors,] node['authors'] = authors elif node['type'] == 'subcollection': neo_node = [] for sub_node in node['content']: neo_node.append(updateNode(sub_node)) node['content'] = neo_node return node