"""
Tools to build data types have citations.
"""
from __future__ import annotations
from typing import Any, Iterable, TYPE_CHECKING
from betty.model import Entity
from betty.model.association import BidirectionalToMany, ToManyResolver
if TYPE_CHECKING:
from betty.ancestry.citation import Citation
[docs]
class HasCitations(Entity):
"""
An entity with citations that support it.
"""
citations = BidirectionalToMany["HasCitations & Entity", "Citation"](
"betty.ancestry.has_citations:HasCitations",
"citations",
"betty.ancestry.citation:Citation",
"facts",
title="Citations",
description="The citations backing up the claims made by this entity",
)