(cubicweb.web.views.boxes

边栏

此视图通常显示主视图中某些相关实体的侧框。

动作盒

The add_related is an automatic menu in the action box that allows to create an entity automatically related to the initial entity (context in which the box is displayed). By default, the links generated in this box are computed from the schema properties of the displayed entity, but it is possible to explicitly specify them thanks to the cubicweb.web.views.uicfg.rmode relation tag:

  • link ,表示通常创建的关系指向现有实体,不应显示此关系的链接。

  • create ,表示通常创建的关系指向新实体,我们应该显示一个链接以创建新实体并自动链接到该实体。

如有必要,可以覆盖该方法 relation_mode(rtype, targettype, x='subject') 动态计算关系创建类别。

请注意,如果至少有一个操作属于 addrelated 分类,自动行为被取消激活,有利于显式行为(例如显示 addrelated 仅类别操作)。