Skip to content

Clone id handling #258

Closed
Closed

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

Activity

  1. self-assigned this
    on Mar 20, 2018
  2. added a commit that references this issue on Oct 25, 2018
    8fae3e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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