|
25 | 25 | """
|
26 | 26 | Child Reference class for Gramps.
|
27 | 27 | """
|
| 28 | + |
28 | 29 | # -------------------------------------------------------------------------
|
29 | 30 | #
|
30 | 31 | # Gramps modules
|
31 | 32 | #
|
32 | 33 | # -------------------------------------------------------------------------
|
33 |
| -from .secondaryobj import SecondaryObject |
34 |
| -from .privacybase import PrivacyBase |
| 34 | +from ..const import GRAMPS_LOCALE as glocale |
| 35 | +from .childreftype import ChildRefType |
35 | 36 | from .citationbase import CitationBase
|
| 37 | +from .const import DIFFERENT, EQUAL, IDENTICAL |
36 | 38 | from .notebase import NoteBase
|
| 39 | +from .privacybase import PrivacyBase |
37 | 40 | from .refbase import RefBase
|
38 |
| -from .childreftype import ChildRefType |
39 |
| -from .const import IDENTICAL, EQUAL, DIFFERENT |
40 |
| -from ..const import GRAMPS_LOCALE as glocale |
| 41 | +from .secondaryobj import SecondaryObject |
41 | 42 |
|
42 | 43 | _ = glocale.translation.gettext
|
43 | 44 |
|
44 | 45 |
|
45 | 46 | # -------------------------------------------------------------------------
|
46 | 47 | #
|
47 |
| -# Person References for Person/Family |
| 48 | +# ChildRef |
48 | 49 | #
|
49 | 50 | # -------------------------------------------------------------------------
|
50 | 51 | class ChildRef(SecondaryObject, PrivacyBase, CitationBase, NoteBase, RefBase):
|
51 | 52 | """
|
52 |
| - Person reference class. |
53 |
| -
|
54 |
| - This class is for keeping information about how the person relates |
55 |
| - to another person from the database, if not through family. |
56 |
| - Examples would be: godparent, friend, etc. |
| 53 | + A class for tracking information about how a child relates to their parents. |
57 | 54 | """
|
58 | 55 |
|
59 | 56 | def __init__(self, source=None):
|
@@ -120,7 +117,11 @@ def get_schema(cls):
|
120 | 117 | "items": {"type": "string", "maxLength": 50},
|
121 | 118 | "title": _("Notes"),
|
122 | 119 | },
|
123 |
| - "ref": {"type": "string", "maxLength": 50, "title": _("Handle")}, |
| 120 | + "ref": { |
| 121 | + "type": "string", |
| 122 | + "maxLength": 50, |
| 123 | + "title": _("Handle"), |
| 124 | + }, |
124 | 125 | "frel": ChildRefType.get_schema(),
|
125 | 126 | "mrel": ChildRefType.get_schema(),
|
126 | 127 | },
|
@@ -191,11 +192,9 @@ def is_equivalent(self, other):
|
191 | 192 | """
|
192 | 193 | if self.ref != other.ref:
|
193 | 194 | return DIFFERENT
|
194 |
| - else: |
195 |
| - if self.is_equal(other): |
196 |
| - return IDENTICAL |
197 |
| - else: |
198 |
| - return EQUAL |
| 195 | + if self.is_equal(other): |
| 196 | + return IDENTICAL |
| 197 | + return EQUAL |
199 | 198 |
|
200 | 199 | def merge(self, acquisition):
|
201 | 200 | """
|
|
0 commit comments