Skip to content

Let objects without parents have a root-based path

With this MR, path and link behaviour becomes much more like people are used to.

This required some changes to the PathMixin, which now places objects without parents ("detached") at "next to root" level. For example, some detached group foo now has path /foo (prior to this MR, it would have been just foo).

Note: The root still is a hypothetical root, i.e. / does not really exist. However, we could add it at some point, which would make all dantro objects be locatable in a single global data tree ... but that's of little priority right now.

This also required some improvements and changes to the Link class:

  • Side-by-side objects are now accessible without traversal via the parent
    • Example: side-by-side foo and bar can link to each other via bar and foo, respectively (prior to this MR, it would have been ../bar and ../foo ... which makes no sense)
  • Self-links are possible without the anchor being attached inside a data tree (useful for some edge cases; not harmful otherwise)
  • Error messages are improved.

Can this MR be accepted?

  • Implemented the changes to the PathMixin and Link classes
  • Tests extended and adjusted
  • Pipeline passes
  • Changelog entry added and version bumped to 0.10.0rc2
  • Approved by @herdeanu

Anything to double-check?

Path and link behaviour reasonable?

Edited by Utopia Developers

Merge request reports