I thought I would try writing a Quickview gramplet to show the associations of a person. I realize there is already an associations tool, but I think it would be handy to have a gramplet to show the associations of the current person, without have to edit the person to see them.
I copied the example quickview for siblings but got stuck trying to find the simple access version of a personref for the associations. Maybe there isn’t one?
stab = QuickTable(sdb) sdoc.header1(_("Associations")) stab.columns(_("Name"), _("ID"), _("Association")) # loop through each association of the person for _?_ in sdb._?_(person) stab.row(_?_, sdb.name(_?_), sdb.gid(_?_), sdb.(_?_)) document.has_data = True stab.write(sdoc)
I’m also wondering if I’m using associations correctly. I have an obituary which mentions the deceased woman’s grandson. But I don’t know which of her children he was a child of. So I want to associate them. I created an association (while editing him), pointing to her, with the association as “Grandmother”, which I thought was the correct way to do it. But the association tool says that he is the grandmother of her.