Coverage for apis_core/relations/abc.py: 0%
58 statements
« prev ^ index » next coverage.py v7.5.3, created at 2025-06-25 10:00 +0000
« prev ^ index » next coverage.py v7.5.3, created at 2025-06-25 10:00 +0000
1from django.utils.translation import gettext_lazy as _
3from apis_core.apis_entities.abc import E21_Person, E53_Place, E74_Group
4from apis_core.relations.models import Relation
7class IsMemberOf(Relation):
8 subj_model = E21_Person
9 obj_model = E74_Group
11 class Meta:
12 abstract = True
14 @classmethod
15 def name(self) -> str:
16 return _("is member of")
18 @classmethod
19 def reverse_name(self) -> str:
20 return _("has as member")
23class LivesIn(Relation):
24 subj_model = E21_Person
25 obj_model = E53_Place
27 class Meta:
28 abstract = True
30 @classmethod
31 def name(self) -> str:
32 return _("lives in")
34 @classmethod
35 def reverse_name(self) -> str:
36 return _("has habitant")
39class IsLocatedIn(Relation):
40 subj_model = E53_Place
41 obj_model = E53_Place
43 class Meta:
44 abstract = True
46 @classmethod
47 def name(self) -> str:
48 return _("is located in")
50 @classmethod
51 def reverse_name(self) -> str:
52 return _("is location of")
55class BornIn(Relation):
56 subj_model = E21_Person
57 obj_model = E53_Place
59 class Meta:
60 abstract = True
62 @classmethod
63 def name(self) -> str:
64 return _("born in")
66 @classmethod
67 def reverse_name(self) -> str:
68 return _("is birth place of")
71class DiedIn(Relation):
72 subj_model = E21_Person
73 obj_model = E53_Place
75 class Meta:
76 abstract = True
78 @classmethod
79 def name(self) -> str:
80 return _("died in")
82 @classmethod
83 def reverse_name(self) -> str:
84 return _("is place of death of")