Closed iLLiCiTiT closed 4 months ago
Not sure if I understand what this function should be for.
I tested it with:
from ayon_core.client import get_version_by_id
from ayon_api.operations import prepare_changes
orig_ver_doc = get_version_by_id ("ayon_test", "7039cfd5c5d711ee83b2d88083815492")
ver_doc = get_version_by_id ("ayon_test", "7039cfd5c5d711ee83b2d88083815492")
ver_doc["author"] = "different author"
changes = (orig_ver_doc, ver_doc, "version")
print(changes)
and only see change in author
key, but got, what it seems, full version doc.
I tested it with:
You forgot to call the function.
changes = (orig_ver_doc, ver_doc, "version")
> changes = prepare_changes(orig_ver_doc, ver_doc, "version")
full version doc.
I would start to call them entities instead of docs. They were called docs because they were mongo documents in OpenPype.
Description
Added helper function
prepare_changes
to make simple diff for updates. Functionnew_hero_version_entity
reusenew_version_entity
Fix duplicated assignment ofdata
variable.