Is there something like a "symbolic link" (in terms of "nixes"), but for objects in ZODB in Plone?

Suppose I have an object in /school1/document-rules .

Suppose in a different context /school2 I need to have the same document-rules that is available in /school1/document-rules .

In ZODB, having /school1/document-rules and /school2/document-rules , I have two different objects.

I would like to know if it is possible to make /school2/document-rules link /school1/document-rules . Thus, /school2/document-rules will be something like "ReferenceDocument", "ReferenceLink" or something like a symbolic link that just points to /school1/document-rules .

Why? The document is the same, but sometimes it makes sense (in semantic terms) to have the same document in different contexts. I have portlets that are displayed depending on their context, and I do not want to duplicate document-rules .

Is there something like what I'm looking for? Bultin or using a module?

+4
source share
3 answers

SimpleAlias does what you want. I used it and it works well. You can also see collective.alias

+7
source

ZODB handles links transparently, as you would expect in plain Python. You have a nice explanation here .

You must keep track of multiple links for the same object when you want to delete an object. To do this, you can use weak links for your "symbolic links" using the weakref module from ZODB , which is equivalent to the weakref standard Python library.

+1
source

I used a product called RedirectionTool for this.

+1
source

Source: https://habr.com/ru/post/1337530/


All Articles