Add title properties to more of schema

This commit is contained in:
prculley 2017-07-17 15:48:18 +01:00 committed by Nick Hall
parent d6ca3cf527
commit f40526366a
14 changed files with 166 additions and 56 deletions

View File

@ -38,6 +38,8 @@ from .notebase import NoteBase
from .datebase import DateBase
from .locationbase import LocationBase
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -92,24 +94,37 @@ class Address(SecondaryObject, PrivacyBase, CitationBase, NoteBase, DateBase,
from .date import Date
return {
"type": "object",
"title": _("Address"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"citation_list": {"type": "array",
"title": _("Citations"),
"items": {"type": "string",
"maxLength": 50}},
"note_list": {"type": "array",
"title": _("Notes"),
"items": {"type": "string",
"maxLength": 50}},
"date": {"oneOf": [{"type": "null"}, Date.get_schema()]},
"street": {"type": "string"},
"locality": {"type": "string"},
"city": {"type": "string"},
"county": {"type": "string"},
"state": {"type": "string"},
"country": {"type": "string"},
"postal": {"type": "string"},
"phone": {"type": "string"}
"date": {"oneOf": [{"type": "null"}, Date.get_schema()],
"title": _("Date")},
"street": {"type": "string",
"title": _("Street")},
"locality": {"type": "string",
"title": _("Locality")},
"city": {"type": "string",
"title": _("City")},
"county": {"type": "string",
"title": _("County")},
"state": {"type": "string",
"title": _("State")},
"country": {"type": "string",
"title": _("Country")},
"postal": {"type": "string",
"title": _("Postal Code")},
"phone": {"type": "string",
"title": _("Phone")}
}
}

View File

@ -36,6 +36,8 @@ from .citationbase import CitationBase
from .notebase import NoteBase
from .attrtype import AttributeType
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -231,17 +233,22 @@ class Attribute(AttributeRoot, CitationBase, NoteBase):
"""
return {
"type": "object",
"title": _("Attribute"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"citation_list": {"type": "array",
"title": _("Citations"),
"items": {"type": "string",
"maxLength": 50}},
"note_list": {"type": "array",
"items": {"type": "string",
"maxLength": 50}},
"maxLength": 50},
"title": _("Notes")},
"type": AttributeType.get_schema(),
"value": {"type": "string"}
"value": {"type": "string",
"title": _("Value")}
}
}

View File

@ -37,6 +37,8 @@ from .notebase import NoteBase
from .refbase import RefBase
from .childreftype import ChildRefType
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -100,17 +102,22 @@ class ChildRef(SecondaryObject, PrivacyBase, CitationBase, NoteBase, RefBase):
"""
return {
"type": "object",
"title": _("Child Reference"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"citation_list": {"type": "array",
"items": {"type": "string",
"maxLength": 50}},
"maxLength": 50},
"title": _("Citations")},
"note_list": {"type": "array",
"items": {"type": "string",
"maxLength": 50}},
"maxLength": 50},
"title": _("Notes")},
"ref": {"type": "string",
"maxLength": 50},
"maxLength": 50,
"title": _("Handle")},
"frel": ChildRefType.get_schema(),
"mrel": ChildRefType.get_schema()
}

View File

@ -703,16 +703,24 @@ class Date:
"""
return {
"type": "object",
"title": _("Date"),
"properties": {
"_class": {"enum": [cls.__name__]},
"calendar": {"type": "integer"},
"modifier": {"type": "integer"},
"quality": {"type": "integer"},
"calendar": {"type": "integer",
"title": _("Calendar")},
"modifier": {"type": "integer",
"title": _("Modifier")},
"quality": {"type": "integer",
"title": _("Quality")},
"dateval": {"type": "array",
"title": _("Values"),
"items": {"type": ["integer", "boolean"]}},
"text": {"type": "string"},
"sortval": {"type": "integer"},
"newyear": {"type": "integer"}
"text": {"type": "string",
"title": _("Text")},
"sortval": {"type": "integer",
"title": _("Sort value")},
"newyear": {"type": "integer",
"title": _("New year begins")}
}
}

View File

@ -167,21 +167,31 @@ class LdsOrd(SecondaryObject, CitationBase, NoteBase,
from .date import Date
return {
"type": "object",
"title": _("LDS Ordinance"),
"properties": {
"_class": {"enum": [cls.__name__]},
"citation_list": {"type": "array",
"title": _("Citations"),
"items": {"type": "string",
"maxLength": 50}},
"note_list": {"type": "array",
"title": _("Notes"),
"items": {"type": "string",
"maxLength": 50}},
"date": {"oneOf": [{"type": "null"}, Date.get_schema()]},
"type": {"type": "integer"},
"place": {"type": "string"},
"famc": {"type": ["null", "string"]},
"temple": {"type": "string"},
"status": {"type": "integer"},
"private": {"type": "boolean"}
"date": {"oneOf": [{"type": "null"}, Date.get_schema()],
"title": _("Date")},
"type": {"type": "integer",
"title": _("Type")},
"place": {"type": "string",
"title": _("Place")},
"famc": {"type": ["null", "string"],
"title": _("Family")},
"temple": {"type": "string",
"title": _("Temple")},
"status": {"type": "integer",
"title": _("Status")},
"private": {"type": "boolean",
"title": _("Private")}
}
}

View File

@ -33,6 +33,8 @@ Location class for Gramps.
from .secondaryobj import SecondaryObject
from .locationbase import LocationBase
from .const import IDENTICAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -82,17 +84,27 @@ class Location(SecondaryObject, LocationBase):
"""
return {
"type": "object",
"title": _("Location"),
"properties": {
"_class": {"enum": [cls.__name__]},
"street": {"type": "string"},
"locality": {"type": "string"},
"city": {"type": "string"},
"county": {"type": "string"},
"state": {"type": "string"},
"country": {"type": "string"},
"postal": {"type": "string"},
"phone": {"type": "string"},
"parish": {"type": "string"}
"street": {"type": "string",
"title": _("Street")},
"locality": {"type": "string",
"title": _("Locality")},
"city": {"type": "string",
"title": _("City")},
"county": {"type": "string",
"title": _("County")},
"state": {"type": "string",
"title": _("State")},
"country": {"type": "string",
"title": _("Country")},
"postal": {"type": "string",
"title": _("Postal Code")},
"phone": {"type": "string",
"title": _("Phone")},
"parish": {"type": "string",
"title": _("Parish")}
}
}

View File

@ -38,6 +38,8 @@ from .notebase import NoteBase
from .refbase import RefBase
from .attrbase import AttributeBase
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -81,24 +83,31 @@ class MediaRef(SecondaryObject, PrivacyBase, CitationBase, NoteBase, RefBase,
from .attribute import Attribute
return {
"type": "object",
"title": _("Media ref"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"citation_list": {"type": "array",
"title": _("Citations"),
"items": {"type": "string",
"maxLength": 50}},
"note_list": {"type": "array",
"title": _("Notes"),
"items": {"type": "string",
"maxLength": 50}},
"attribute_list": {"type": "array",
"title": _("Attributes"),
"items": Attribute.get_schema()},
"ref": {"type": "string",
"title": _("Handle"),
"maxLength": 50},
"rect": {"oneOf": [{"type": "null"},
{"type": "array",
"items": {"type": "integer"},
"minItems": 4,
"maxItems": 4}]}
"maxItems": 4}],
"title": _("Region")}
}
}

View File

@ -37,6 +37,8 @@ from .citationbase import CitationBase
from .notebase import NoteBase
from .refbase import RefBase
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -93,18 +95,24 @@ class PersonRef(SecondaryObject, PrivacyBase, CitationBase, NoteBase, RefBase):
"""
return {
"type": "object",
"title": _("Person ref"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"citation_list": {"type": "array",
"title": _("Citations"),
"items": {"type": "string",
"maxLength": 50}},
"note_list": {"type": "array",
"title": _("Notes"),
"items": {"type": "string",
"maxLength": 50}},
"ref": {"type": "string",
"title": _("Handle"),
"maxLength": 50},
"rel": {"type": "string"}
"rel": {"type": "string",
"title": _("Association")}
}
}

View File

@ -31,6 +31,8 @@ Place name class for Gramps
from .secondaryobj import SecondaryObject
from .datebase import DateBase
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -90,11 +92,15 @@ class PlaceName(SecondaryObject, DateBase):
from .date import Date
return {
"type": "object",
"title": _("Place Name"),
"properties": {
"_class": {"enum": [cls.__name__]},
"value": {"type": "string"},
"date": {"oneOf": [{"type": "null"}, Date.get_schema()]},
"lang": {"type": "string"}
"value": {"type": "string",
"title": _("Text")},
"date": {"oneOf": [{"type": "null"}, Date.get_schema()],
"title": _("Date")},
"lang": {"type": "string",
"title": _("Language")}
}
}

View File

@ -32,6 +32,8 @@ from .secondaryobj import SecondaryObject
from .refbase import RefBase
from .datebase import DateBase
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -82,11 +84,14 @@ class PlaceRef(RefBase, DateBase, SecondaryObject):
from .date import Date
return {
"type": "object",
"title": _("Place ref"),
"properties": {
"_class": {"enum": [cls.__name__]},
"ref": {"type": "string",
"title": _("Handle"),
"maxLength": 50},
"date": {"oneOf": [{"type": "null"}, Date.get_schema()]}
"date": {"oneOf": [{"type": "null"}, Date.get_schema()],
"title": _("Date")}
}
}

View File

@ -36,6 +36,8 @@ from .notebase import NoteBase
from .refbase import RefBase
from .srcmediatype import SourceMediaType
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -91,16 +93,21 @@ class RepoRef(SecondaryObject, PrivacyBase, NoteBase, RefBase):
"""
return {
"type": "object",
"title": _("Repository ref"),
"properties": {
"_class": {"enum": [cls.__name__]},
"note_list": {"type": "array",
"title": _("Notes"),
"items": {"type": "string",
"maxLength": 50}},
"ref": {"type": "string",
"title": _("Handle"),
"maxLength": 50},
"call_number": {"type": "string"},
"call_number": {"type": "string",
"title": _("Call Number")},
"media_type": SourceMediaType.get_schema(),
"private": {"type": "boolean"}
"private": {"type": "boolean",
"title": _("Private")}
}
}

View File

@ -30,6 +30,8 @@ Source Attribute class for Gramps.
#-------------------------------------------------------------------------
from .attribute import AttributeRoot
from .srcattrtype import SrcAttributeType
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -65,10 +67,13 @@ class SrcAttribute(AttributeRoot):
"""
return {
"type": "object",
"title": _("Attribute"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"private": {"type": "boolean",
"title": _("Private")},
"type": SrcAttributeType.get_schema(),
"value": {"type": "string"}
"value": {"type": "string",
"title": _("Value")}
}
}

View File

@ -28,6 +28,8 @@
#
#-------------------------------------------------------------------------
from .styledtexttagtype import StyledTextTagType
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -96,14 +98,17 @@ class StyledTextTag:
"""
return {
"type": "object",
"title": _("Tag"),
"properties": {
"_class": {"enum": [cls.__name__]},
"name": StyledTextTagType.get_schema(),
"value": {"type": ["null", "string", "integer"]},
"value": {"type": ["null", "string", "integer"],
"title": _("Value")},
"ranges": {"type": "array",
"items": {"type": "array",
"items": {"type": "integer"},
"minItems": 2,
"maxItems": 2}}
"maxItems": 2},
"title": _("Ranges")}
}
}

View File

@ -41,6 +41,8 @@ from .secondaryobj import SecondaryObject
from .privacybase import PrivacyBase
from .urltype import UrlType
from .const import IDENTICAL, EQUAL, DIFFERENT
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
@ -83,11 +85,15 @@ class Url(SecondaryObject, PrivacyBase):
"""
return {
"type": "object",
"title": _("Url"),
"properties": {
"_class": {"enum": [cls.__name__]},
"private": {"type": "boolean"},
"path": {"type": "string"},
"desc": {"type": "string"},
"private": {"type": "boolean",
"title": _("Private")},
"path": {"type": "string",
"title": _("Path")},
"desc": {"type": "string",
"title": _("Description")},
"type": UrlType.get_schema()
}
}