Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clone id handling #258

@mpsonntag

Description

@mpsonntag

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__.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions