1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Person Reference class for GRAMPS.
25 """
26
27
28
29
30
31
32 from gen.lib.secondaryobj import SecondaryObject
33 from gen.lib.privacybase import PrivacyBase
34 from gen.lib.srcbase import SourceBase
35 from gen.lib.notebase import NoteBase
36 from gen.lib.refbase import RefBase
37
38
39
40
41
42
43 -class PersonRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase):
44 """
45 Person reference class.
46
47 This class is for keeping information about how the person relates
48 to another person from the database, if not through family.
49 Examples would be: godparent, friend, etc.
50 """
51
61
71
82
84 """
85 Return the list of all textual attributes of the object.
86
87 @return: Returns the list of all textual attributes of the object.
88 @rtype: list
89 """
90 return [self.rel]
91
93 """
94 Return the list of child objects that may carry textual data.
95
96 @return: Returns the list of child objects that may carry textual data.
97 @rtype: list
98 """
99 return self.source_list
100
102 """
103 Return the list of child secondary objects that may refer notes.
104
105 @return: Returns the list of child secondary child objects that may
106 refer notes.
107 @rtype: list
108 """
109 return self.source_list
110
112 """
113 Return the list of (classname, handle) tuples for all directly
114 referenced primary objects.
115
116 @return: List of (classname, handle) tuples for referenced objects.
117 @rtype: list
118 """
119 ret = self.get_referenced_note_handles()
120 if self.ref:
121 ret += [('Person', self.ref)]
122 return ret
123
125 """
126 Return the list of child objects which may, directly or through
127 their children, reference primary objects..
128
129 @return: Returns the list of objects refereincing primary objects.
130 @rtype: list
131 """
132 return self.source_list
133
135 """Set relation to a person."""
136 self.rel = rel
137
139 """Return the relation to a person."""
140 return self.rel
141