Classes for relationships.
Bases: object
The relationship calculator helps to determine the relationship between two people.
Internal method to condense the relationships as returned by get_relationship_distance_new. Common ancestors in the same family are collapsed to one entry, changing the person paths to family paths, eg ‘mf’ and ‘mm’ become ‘ma’
We can save work by storing a map, however, if database changes this map must be regenerated. Before close, the calling app must call disconnect_db_signals
Method to disconnect to all signals the relationship calculator is subscribed
Return a tuple, of which the first entry is a list with all relationships in text, and the second a list of lists of all common ancestors that have that text as relationship
Method that returns the birthparents of a person as tuple (mother handle, father handle), if no known birthparent, the handle is replaced by None
Returns a string representing the most relevant relationship between the two people. If extra_info = True, extra information is returned: (relation_string, distance_common_orig, distance_common_other)
If olocale is passed in (a GrampsLocale) that language will be used.
Parameters: | olocale (a GrampsLocale instance) – allow selection of the relationship language |
---|
Determine the string giving the relation between two partners of type spouse_type. Eg: b is the spouse of a Here ‘spouse’ is the string we need to determine
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AS GETTEXT IS ALREADY USED !
Provide a string that describes the relationsip between a person, and a group of people with the same relationship. E.g. “grandparents” or “children”.
Ga and Gb can be used to mathematically calculate the relationship.
Parameters: |
|
---|---|
Returns: | A string describing the relationship between the person and the group. |
Return type: | str |
Return if all_dist == True a ‘tuple, string’: (rank, person handle, firstRel_str, firstRel_fam, secondRel_str, secondRel_fam), msg or if all_dist == True a ‘list of tuple, string’: [.....], msg:
Note
_new can be removed once all rel_xx modules no longer overwrite get_relationship_distance
The tuple or list of tuples consists of:
Element | Description |
---|---|
rank | Total number of generations from common ancestor to the two persons, rank is -1 if no relations found |
person_handle | The Common ancestor |
firstRel_str | String with the path to the common ancestor from orig Person |
firstRel_fam | Family numbers along the path as a list, eg [0,0,1]. For parent in multiple families, eg [0. [0, 2], 1] |
secondRel_str | String with the path to the common ancestor from otherPerson |
secondRel_fam | Family numbers along the path, eg [0,0,1]. For parent in multiple families, eg [0. [0, 2], 1] |
msg | List of messages indicating errors. Empyt list if no errors. |
Example: firstRel_str = ‘ffm’ and firstRel_fam = [2,0,1] means common ancestor is mother of the second family of the father of the first family of the father of the third family.
Note that the same person might be present twice if the person is reached via a different branch too. Path (firstRel_str and secondRel_str) will of course be different.
Parameters: |
|
---|
Determine the string giving the relation between two siblings of type sib_type. Eg: b is the brother of a Here ‘brother’ is the string we need to determine This method gives more details about siblings than get_single_relationship_string can do.
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AND SAME METHODS EXIST (get_uncle, get_aunt, get_sibling)
Translation free determination of type of orig and other as siblings The procedure returns sibling types, these can be passed to get_sibling_relationship_string. Only call this method if known that orig and other are siblings
Provide a string that describes the relationsip between a person, and another person. E.g. “grandparent” or “child”.
To be used as: ‘person b is the grandparent of a’, this will be in translation string: ‘person b is the %(relation)s of a’
Note that languages with gender should add ‘the’ inside the translation, so eg in french: ‘person b est %(relation)s de a’ where relation will be here: le grandparent
Ga and Gb can be used to mathematically calculate the relationship.
Some languages need to know the specific path to the common ancestor. Those languages should use reltocommon_a and reltocommon_b which is a string like ‘mfmf’.
The possible string codes are:
Code | Description |
---|---|
REL_MOTHER | # going up to mother |
REL_FATHER | # going up to father |
REL_MOTHER_NOTBIRTH | # going up to mother, not birth relation |
REL_FATHER_NOTBIRTH | # going up to father, not birth relation |
REL_FAM_BIRTH | # going up to family (mother and father) |
REL_FAM_NONBIRTH | # going up to family, not birth relation |
REL_FAM_BIRTH_MOTH_ONLY | # going up to fam, only birth rel to mother |
REL_FAM_BIRTH_FATH_ONLY | # going up to fam, only birth rel to father |
Prefix codes are stripped, so REL_FAM_INLAW_PREFIX is not present. If the relation starts with the inlaw of the person a, then ‘in_law_a’ is True, if it starts with the inlaw of person b, then ‘in_law_b’ is True.
Also REL_SIBLING (# going sideways to sibling (no parents)) is not passed to this routine. The collapse_relations changes this to a family relation.
Hence, calling routines should always strip REL_SIBLING and REL_FAM_INLAW_PREFIX before calling get_single_relationship_string() Note that only_birth=False, means that in the reltocommon one of the NOTBIRTH specifiers is present.
The REL_FAM identifiers mean that the relation is not via a common ancestor, but via a common family (note that that is not possible for direct descendants or direct ancestors!). If the relation to one of the parents in that common family is by birth, then ‘only_birth’ is not set to False. The only_birth() method is normally used for this.
Parameters: |
|
---|---|
Returns: | A string describing the relationship between the two people |
Return type: | str |
Note
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Return a string representing the relationshp between the two people, along with a list of common ancestors (typically father,mother)
Special cases: relation strings “”, “undefined” and “spouse”.
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Spanish version of method to create relation string - check relationship.py
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
voir relationship.py
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
returns a string representing the relationshp between the two people, along with a list of common ancestors (typically father,mother)
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
returns a string representing the relationshp between the two people, along with a list of common ancestors (typically father, mother)
Determine the string giving the relation between two siblings of type sib_type. Eg: b is the brother of a Here ‘brother’ is the string we need to determine This method gives more details about siblings than get_single_relationship_string can do.
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AND SAME METHODS EXIST (get_uncle, get_aunt, get_sibling)
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Determine the string giving the relation between two siblings of type sib_type. Eg: b is the brother of a Here ‘brother’ is the string we need to determine This method gives more details about siblings than get_single_relationship_string can do.
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AND SAME METHODS EXIST (get_uncle, get_aunt, get_sibling)
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Podaje tekst zawierający informację, jak bardzo potomek o nieokreślonej płci jest spokrewniony dodanej osoby
Podaje tekst zawierający informację, jak bardzo potomek żeński (np. córka) jest spokrewniony do danej osoby
Podaje tekst zawierający informację, jak bardzo przodek męski (np. ojciec) jest spokrewniony do danej osoby
Podaje tekst zawierający informację, jak bardzo przodek żeński (np. matka) jest spokrewniony do danej osoby
Podaje tekst zawierający informację, jak bardzo przodek o nieokreślonej płci jest spokrewniony dodanej osoby
Generate a text with information, how far away is a group of persons from a main person
Provide a string that describes the relationsip between a person, and another person. E.g. “grandparent” or “child”.
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Cria o objeto KinshipReport que produz o relatório. Os argumentos são: database - a instância do banco de dados GRAMPS options_class - instância da classe das opções para este relatório O presente relatório tem os seguintes parâmetros (variáveis de classe) que entram na classe de opções. maxdescend - Máximo gerações de descendentes para incluir. maxascend - Máximo de gerações ancestrais para incluir. incspouses - Se deseja incluir cônjuges. inccousins - Se deseja incluir primos. incaunts - Se deseja incluir tios / sobrinhos. pid - A identificação Gramps da pessoa central para o relatório.
Preenche um mapa das matrizes contendo os descendentes da pessoa falecida. Esta função chama a si mesma recursivamente até atingir max_descend. Parâmetros:
Parameters: |
|
---|
Preenche um mapa das matrizes contendo os ancestrais da pessoa falecida. Esta função chama a si mesma recursivamente até atingir max_ascend. Parâmetros:
Parameters: |
|
---|
returns a string representing the relationshp between the two people, along with a list of common ancestors (typically father, mother)
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
see relationship.py
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Determine the string giving the relation between two siblings of type sib_type. Eg: b is the brother of a Here ‘brother’ is the string we need to determine This method gives more details about siblings than get_single_relationship_string can do.
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AND SAME METHODS EXIST (get_uncle, get_aunt, get_sibling)
Provide a string that describes the relationsip between a person, and another person. E.g. “grandparent” or “child”.
To be used as: ‘person b is the grandparent of a’, this will be in translation string: ‘person b is the %(relation)s of a’
Note that languages with gender should add ‘the’ inside the translation, so eg in french: ‘person b est %(relation)s de a’ where relation will be here: le grandparent
Ga and Gb can be used to mathematically calculate the relationship.
Some languages need to know the specific path to the common ancestor. Those languages should use reltocommon_a and reltocommon_b which is a string like ‘mfmf’.
The possible string codes are:
Code | Description |
---|---|
REL_MOTHER | # going up to mother |
REL_FATHER | # going up to father |
REL_MOTHER_NOTBIRTH | # going up to mother, not birth relation |
REL_FATHER_NOTBIRTH | # going up to father, not birth relation |
REL_FAM_BIRTH | # going up to family (mother and father) |
REL_FAM_NONBIRTH | # going up to family, not birth relation |
REL_FAM_BIRTH_MOTH_ONLY | # going up to fam, only birth rel to mother |
REL_FAM_BIRTH_FATH_ONLY | # going up to fam, only birth rel to father |
Prefix codes are stripped, so REL_FAM_INLAW_PREFIX is not present. If the relation starts with the inlaw of the person a, then ‘in_law_a’ is True, if it starts with the inlaw of person b, then ‘in_law_b’ is True.
Also REL_SIBLING (# going sideways to sibling (no parents)) is not passed to this routine. The collapse_relations changes this to a family relation.
Hence, calling routines should always strip REL_SIBLING and REL_FAM_INLAW_PREFIX before calling get_single_relationship_string() Note that only_birth=False, means that in the reltocommon one of the NOTBIRTH specifiers is present.
The REL_FAM identifiers mean that the relation is not via a common ancestor, but via a common family (note that that is not possible for direct descendants or direct ancestors!). If the relation to one of the parents in that common family is by birth, then ‘only_birth’ is not set to False. The only_birth() method is normally used for this.
Parameters: |
|
---|---|
Returns: | A string describing the relationship between the two people |
Return type: | str |
Note
Bases: gramps.gen.relationship.RelationshipCalculator
RelationshipCalculator Class
Provide a string that describes the relationsip between a person, and a group of people with the same relationship. E.g. “grandparents” or “children”.
Ga and Gb can be used to mathematically calculate the relationship.
Parameters: |
|
---|---|
Returns: | A string describing the relationship between the person and the group. |
Return type: | str |
Determine the string giving the relation between two siblings of type sib_type. Eg: b is the brother of a Here ‘brother’ is the string we need to determine This method gives more details about siblings than get_single_relationship_string can do.
Warning
DON’T TRANSLATE THIS PROCEDURE IF LOGIC IS EQUAL IN YOUR LANGUAGE, AND SAME METHODS EXIST (get_uncle, get_aunt, get_sibling)
Provide a string that describes the relationsip between a person, and another person. E.g. “grandparent” or “child”.
To be used as: ‘person b is the grandparent of a’, this will be in translation string: ‘person b is the %(relation)s of a’
Note that languages with gender should add ‘the’ inside the translation, so eg in french: ‘person b est %(relation)s de a’ where relation will be here: le grandparent
Ga and Gb can be used to mathematically calculate the relationship.
Some languages need to know the specific path to the common ancestor. Those languages should use reltocommon_a and reltocommon_b which is a string like ‘mfmf’.
The possible string codes are:
Code | Description |
---|---|
REL_MOTHER | # going up to mother |
REL_FATHER | # going up to father |
REL_MOTHER_NOTBIRTH | # going up to mother, not birth relation |
REL_FATHER_NOTBIRTH | # going up to father, not birth relation |
REL_FAM_BIRTH | # going up to family (mother and father) |
REL_FAM_NONBIRTH | # going up to family, not birth relation |
REL_FAM_BIRTH_MOTH_ONLY | # going up to fam, only birth rel to mother |
REL_FAM_BIRTH_FATH_ONLY | # going up to fam, only birth rel to father |
Prefix codes are stripped, so REL_FAM_INLAW_PREFIX is not present. If the relation starts with the inlaw of the person a, then ‘in_law_a’ is True, if it starts with the inlaw of person b, then ‘in_law_b’ is True.
Also REL_SIBLING (# going sideways to sibling (no parents)) is not passed to this routine. The collapse_relations changes this to a family relation.
Hence, calling routines should always strip REL_SIBLING and REL_FAM_INLAW_PREFIX before calling get_single_relationship_string() Note that only_birth=False, means that in the reltocommon one of the NOTBIRTH specifiers is present.
The REL_FAM identifiers mean that the relation is not via a common ancestor, but via a common family (note that that is not possible for direct descendants or direct ancestors!). If the relation to one of the parents in that common family is by birth, then ‘only_birth’ is not set to False. The only_birth() method is normally used for this.
Parameters: |
|
---|---|
Returns: | A string describing the relationship between the two people |
Return type: | str |
Note