From a3c0ff5c1806dd60674f7c626e7fc5fd70097c4d Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 10 Jan 2016 18:37:13 -0500 Subject: [PATCH] Add missing EventRef.get_schema() --- gramps/gen/lib/eventref.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gramps/gen/lib/eventref.py b/gramps/gen/lib/eventref.py index 66edcca16..c06686e2f 100644 --- a/gramps/gen/lib/eventref.py +++ b/gramps/gen/lib/eventref.py @@ -108,8 +108,32 @@ class EventRef(PrivacyBase, NoteBase, AttributeBase, RefBase, "role": self.__role.to_struct() } + @classmethod + def get_schema(cls): + """ + Returns the schema for EventRef. + + :returns: Returns a dict containing the fields to types. + :rtype: dict + """ + from .attribute import Attribute + return { + "private": bool, + "note_list": [Handle("Note", "NOTE-HANDLE")], + "attribute_list": [Attribute], + "ref": Handle("Event", "EVENT-HANDLE"), + "role": EventRoleType, + } + @classmethod def get_labels(cls, _): + """ + Given a translation function, returns the labels for + each field of this object. + + :returns: Returns a dict containing the fields to labels. + :rtype: dict + """ return { "private": _("Private"), "note_list": _("Notes"), @@ -252,4 +276,3 @@ class EventRef(PrivacyBase, NoteBase, AttributeBase, RefBase, """ self.__role.set(role) role = property(get_role, set_role, None, 'Returns or sets role property') -