Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clone id handling #258

Closed
mpsonntag opened this issue Mar 20, 2018 · 0 comments · Fixed by #304
Closed

Clone id handling #258

mpsonntag opened this issue Mar 20, 2018 · 0 comments · Fixed by #304
Assignees

Comments

@mpsonntag
Copy link
Contributor

mpsonntag commented Mar 20, 2018

Currently the id of a Property, Section or a Document (and their children) remains the same if the object is cloned.

  • Since these ids should be used only once in a Document, by default the id of the clone and all potentially cloned children should be set to new UUIDs.
  • The id attribute has to be excluded in the baseobject.__eq__() method.
  • The clone method should also contain a keep_id flag which by default is False. If set to True, the old id value is kept e.g. when attaching the exact same odML object to another Document.
  • An additional validation check needs to prohibit the saving of a Document containing odML objects with identical ids.
  • Currently ids of an odML entity cannot be set or changed after they have been created. Add a method new_id() to assign a new UUID to an odML entity analogous to the UUID assignment in the odML Entity __init__.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant