Skip to content

Commit 1d39310

Browse files
committed
Expand documentation on rev_multilink
1 parent e440e80 commit 1d39310

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

doc/customizing.txt

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,11 +719,56 @@ behaviour:
719719
- The ``rev_multilink`` option takes a property name to be inserted
720720
into the linked-to class. This property is a Multilink property that
721721
links back to the current class. The new Multilink is read-only (it
722-
is automagically modified if the Link or Multilink property defining
722+
is automatically modified if the Link or Multilink property defining
723723
it is modified). The new property can be used in normal searches
724724
using the "filter" method of the Class. This means it can be used
725725
like other Multilink properties when searching (in an index
726726
template) or via the REST- and XMLRPC-APIs.
727+
728+
As a example, suppose you want to group multiple issues into a
729+
super issue. Each issue can be part of only one super issue. It is
730+
inefficient to find all of the issues that are part of the
731+
super issue by searching through all issues in the system looking
732+
at the part_of link property. To make this more efficient, you
733+
can declare an issue's part_of property as::
734+
735+
issue = IssueClass(db, "issue",
736+
...
737+
part_of = Link("issue", rev_multilink="components"),
738+
... )
739+
740+
This automatically creates the ``components`` multilink on the issue
741+
class. The ``components`` multilink is never explicitly declared in
742+
the issue class, but it has the same effect as though you had
743+
declared the class as::
744+
745+
issue = IssueClass(db, "issue",
746+
...
747+
part_of = Link("issue"),
748+
components = Multilink("issue")
749+
... )
750+
751+
Then wrote a detector to update the components property on the
752+
corresponding issue. Writing this detector can be tricky. There is
753+
one other difference, you can not explicitly set/modify the
754+
``components`` multilink.
755+
756+
The effect of setting ``part_of = 3456`` on issue1234
757+
automatically adds "1234" to the ``components`` property on
758+
issue3456. You can search the ``components`` multilink just like a
759+
regular multilink, but you can't explicitly assign to it.
760+
761+
You can also link between different classes. So you can modify
762+
the issue definition to include::
763+
764+
issue = IssueClass(db, "issue",
765+
...
766+
assigned_to = Link("user", rev_multilink="responsibleFor"),
767+
... )
768+
769+
This makes it easy to list all issues that the user is responsible
770+
for (aka assigned_to).
771+
727772
- The ``msg_header_property`` is used by the mail gateway when sending
728773
out messages. When a link or multilink property of an issue changes,
729774
roundup creates email headers of the form::

0 commit comments

Comments
 (0)