How is the Relationships view so responsive?

How does the Relationships view populate so quickly?

When switching persons in the Relationships view using the example.gramps tree, the view mode updates on my Windoze box in less than a second.


That refresh time includes changing focus, finding the Families that have the Active Person as a child or spouse, all the people in those families, the marriage events for the Families, the birth & death events for all the people, all the Places for those events, and thumbnails for those people. Then it has to build a appropriate layout around all those objects.

All in less than a second.

It is often useful to run a filter that finds a subset of those: all the objects in one View category for immediate family of the Active Person. And to do that, Gramps requires a (divergent set of rules for each Category) complex mulit-stage custom filter. And it has a painfully slow progress bar for each stage.

What is the difference in the way the Relationship view finds this subset of the Tree? Is there a way to grab the populating method for the Relationship view and layer it into a narrow scope modality for the other views?

1 Like

Looking at the gramps/plugins/view/relview.py starting at Line 618, it doesn’t builds lists from queries. It calls functions to return lists of handles from that class.

So… I suppose the budding developers need a great cheatsheet so they don’t re-invent the wheel.

from gramps/gen/lib/person.py#L883
family_handle_list = person.get_family_handle_list()


    def get_family_handle_list(self):
        """
        Return the list of :class:`~.family.Family` handles in which the person
        is a parent or spouse.
        :returns: Returns the list of handles corresponding to the
                  :class:`~.family.Family` records with which the person
                  is associated.
        :rtype: list
        """
        return self.family_list

from gramps/gen/lib/person.py#L934
family_handle_list = person.get_parent_family_handle_list()

    def get_parent_family_handle_list(self):
        """
        Return the list of :class:`~.family.Family` handles in which the person
        is a child.
        :returns: Returns the list of handles corresponding to the
                  :class:`~.family.Family` records with which the person is a
                  child.
        :rtype: list
        """
        return self.parent_family_list