Ejemplo n.º 1
0
 def update_version(cls, version_id, version_json=None, singer=None, song=None):
     # retrieve and update the version object in the desired way
     version = Version().get(version_id, links=True)
     
     if version is None:
         raise NotFoundException()
     
     if version_json is not None:
         version.patch_version(version_json, replace_all=True, keep_id=True)
     if singer is not None:
         version.singer = singer
     if song is not None:
         version.song = song
     version.save()
     
     # call the indexing process, and index this object and all related ones
     VersionIndex.by_id(version.id, cascade=True)
     
     return version