Menu

Making 1:N relationship visible on both objects.

2023-08-04
2023-08-07
  • razsalgul1635

    razsalgul1635 - 2023-08-04

    Hello,

    I'm trying to make visible 1:N relationship on both objects. I looked at https://www.itophub.io/wiki/page?do=export_code&id=3_1_0:customization:one-to-one-relation&codeblock=2 but I dont know which part adresses this issue.

    Lets say that we have that car<->person relation.
    * One car has one person but one person can have many cars.
    * On car I can see one person who "drives it".
    * But I cant see on one person how many cars "he drives". It writes an error when I try to open object person.

    I saw that iTOP's IPAM can show that (eg. in SubnetBlock id displays linked Subnets and Subnet displays linked IP adresses) and I discovered its written in some src/ Model/_ IPSubnet.php or _ IPBlock.php file (which is a hell to understand and for copy pasting it I'd need to have IPAM installed - which I dont want that dependency).

    Does anyone know how to adress this issue?

    Thank you.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2023-08-04

    The most simple way is to modify the datamodel XML, and use an AttributeLinkedSet attribute on the person class which then shows the list of cars the person has.

     
  • razsalgul1635

    razsalgul1635 - 2023-08-07

    Thank you. It works. I found similiarity Person <-> Location.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.