1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Child Reference class for GRAMPS.
25 """
26
27
28
29
30
31 from types import InstanceType
32
33
34
35
36
37
38 from gen.lib.secondaryobj import SecondaryObject
39 from gen.lib.privacybase import PrivacyBase
40 from gen.lib.srcbase import SourceBase
41 from gen.lib.notebase import NoteBase
42 from gen.lib.refbase import RefBase
43 from gen.lib.childreftype import ChildRefType
44
45
46
47
48
49
50 -class ChildRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase):
51 """
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.
57 """
58
70
81
96
98 """
99 Return the list of all textual attributes of the object.
100
101 @return: Returns the list of all textual attributes of the object.
102 @rtype: list
103 """
104 return [str(self.frel), str(self.mrel)]
105
107 """
108 Return the list of child objects that may carry textual data.
109
110 @return: Returns the list of child objects that may carry textual data.
111 @rtype: list
112 """
113 return self.source_list
114
116 """
117 Return the list of child secondary objects that may refer notes.
118
119 @return: Returns the list of child secondary child objects that may
120 refer notes.
121 @rtype: list
122 """
123 return self.source_list
124
126 """
127 Return the list of (classname, handle) tuples for all directly
128 referenced primary objects.
129
130 @return: List of (classname, handle) tuples for referenced objects.
131 @rtype: list
132 """
133 ret = self.get_referenced_note_handles()
134 if self.ref:
135 ret += [('Person', self.ref)]
136 return ret
137
139 """
140 Return the list of child objects which may, directly or through their
141 children, reference primary objects..
142
143 @return: Returns the list of objects refereincing primary objects.
144 @rtype: list
145 """
146 return self.source_list
147
149 """Set relation between the person and mother."""
150 self.mrel.set(rel)
151
153 """Return the relation between the person and mother."""
154 return self.mrel
155
157 """Set relation between the person and father."""
158 self.frel.set(frel)
159
161 """Return the relation between the person and father."""
162 return self.frel
163