betty.model package¶
Submodules¶
- betty.model.association module
AssociationRegistryAssociationRequiredBidirectionalToManyBidirectionalToOneBidirectionalToZeroOrOneTemporaryToManyResolverTemporaryToOneResolverTemporaryToZeroOrOneResolverToManyResolverToOneResolverToZeroOrOneResolverUnidirectionalToManyUnidirectionalToOneUnidirectionalToZeroOrOneresolve()
- betty.model.collections module
- betty.model.config module
Module contents¶
Provide Betty’s data model API.
- betty.model.ENTITY_TYPE_REPOSITORY: PluginRepository[Entity] = <betty.plugin.entry_point.EntryPointPluginRepository object>¶
The entity type plugin repository.
Read more about Entity type plugins.
- class betty.model.Entity[source]¶
Bases:
LinkedDataDumpableJsonLdObject,Mutable,PluginAn entity is a uniquely identifiable data container.
Read more about Entity type plugins.
To test your own subclasses, use
betty.test_utils.model.EntityTestBase.- property ancestry_id: tuple[builtins.type[Self], str]¶
The ancestry ID.
This MUST be unique per ancestry.
- get_mutable_instances() Iterable[Mutable][source]¶
Get any other
betty.mutability.Mutableinstances contained by this one.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) JsonLdObject[source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data().
- classmethod plugin_label_count(count: int) Localizable[source]¶
The human-readable entity type label for the given entity count.
- abstractmethod classmethod plugin_label_plural() Localizable[source]¶
The human-readable entity type label, plural.
- property type: builtins.type[Self]¶
The entity type.
- class betty.model.EntityReferenceCollectionSchema[source]¶
Bases:
ToManySchemaA schema for a collection of references to other entity resources.
- static __new__(*args, **kwargs)¶
- class betty.model.EntityReferenceSchema[source]¶
Bases:
ToOneSchemaA schema for a reference to another entity resource.
- static __new__(*args, **kwargs)¶
- class betty.model.NonPersistentId[source]¶
Bases:
strA randomly generated ID that is not persistent.
Entities must have IDs for identification. However, not all entities can be provided with an ID that exists in the original data set (such as a third-party family tree loaded into Betty).
Non-persistent IDs are helpful in case there is no external ID that can be used. However, as they do not persist when reloading an ancestry, they MUST NOT be in contexts where persistent identifiers are expected, such as in URLs.
- class betty.model.ToZeroOrOneSchema[source]¶
Bases:
OneOfA schema for a to-zero-or-one entity association.
- class betty.model.UserFacingEntity[source]¶
Bases:
UserFacingA sentinel to mark an entity type as being visible to users (e.g. not internal).
- static __new__(*args, **kwargs)¶