From abd69fbebde45f1d4b59858a1f9c8e6d36b10ddb Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 30 Jan 2016 14:44:39 -0500 Subject: [PATCH] Added schema to Tag --- gramps/gen/lib/handle.py | 3 ++- gramps/gen/lib/tag.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gramps/gen/lib/handle.py b/gramps/gen/lib/handle.py index d59ebfc1a..8cbaeb5f1 100644 --- a/gramps/gen/lib/handle.py +++ b/gramps/gen/lib/handle.py @@ -28,7 +28,7 @@ class HandleClass(str): @classmethod def get_schema(cls): from gramps.gen.lib import (Person, Family, Event, Place, Source, - Media, Repository, Note, Citation) + Media, Repository, Note, Citation, Tag) tables = { "Person": Person, "Family": Family, @@ -39,6 +39,7 @@ class HandleClass(str): "Repository": Repository, "Note": Note, "Citation": Citation, + "Tag": Tag, } return tables[cls.classname].get_schema() diff --git a/gramps/gen/lib/tag.py b/gramps/gen/lib/tag.py index a87bcffb5..ad02fee47 100644 --- a/gramps/gen/lib/tag.py +++ b/gramps/gen/lib/tag.py @@ -101,6 +101,19 @@ class Tag(TableObject): self.change) = data return self + @classmethod + def get_schema(cls): + """ + Return the schema for Tag + """ + return { + "handle": Handle("Tag", "TAG-HANDLE"), + "name": str, + "color": str, + "priority": int, + "change": int, + } + def get_text_data_list(self): """ Return the list of all textual attributes of the object.