Changes

Jump to: navigation, search

Specification:Relationship Calculator

14 bytes added, 19:23, 7 March 2007
m
How to write a relationship calculator: correct API links
==How to write a relationship calculator==
The framework for relationship calculator plugins is in place. Here are the rules the language-specific plugins must obey to be compatible with the framework:
# The relationship plugins (here and below referred to as <code>rel</code> plugins) must define a class that can be instantiated with the [http://developerswww.gramps-project.org/devdoc/api/public2.2/private/GrampsDbBaseGrampsDb._GrampsDbBase.GrampsDbBase-class.html GrampsDbBase] instance as its argument and that has a <code>get_relationship</code> method obeying the following rules:#* The arguments of <code>get_relationship</code> method are two [http://developerswww.gramps-project.org/devdoc/api/public2.2/private/RelLib._Person.Person-class.html Person] objects. To be determined is the relationship of the second person to the first person.
#* The values returned by the function are the string of the relationship (e.g. "father", or "grandson") and the list of the closest common ancestors of these two persons.
#* For the sake of the following example, assume that the above function is defined in <code>src/plugins/rel_xx.py</code> (where <code>xx</code> is your language code), and it's name is <code>get_relationship(first_person,second_person)</code>. Also assume that it returns a pair of values: <code>(rel_string, acnestor_list)</code>.

Navigation menu