Coverage for apis_core/apis_entities/abc.py: 92%
25 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
1from django.db import models
3#########################
4# Abstract base classes #
5#########################
8# These abstract base classes are named after
9# CIDOC CRM entities, but we are *NOT*(!)
10# trying to implement CIDOC CRM in Django.
13class E21_Person(models.Model):
14 forename = models.CharField(blank=True, default="", max_length=4096)
15 surname = models.CharField(blank=True, default="", max_length=4096)
16 gender = models.CharField(blank=True, default="", max_length=4096)
17 date_of_birth = models.DateField(blank=True, null=True)
18 date_of_death = models.DateField(blank=True, null=True)
20 class Meta:
21 abstract = True
23 def __str__(self):
24 return f"{self.forename} {self.surname}"
27class E53_Place(models.Model):
28 label = models.CharField(blank=True, default="", max_length=4096)
29 longitude = models.FloatField(blank=True, null=True)
30 latitude = models.FloatField(blank=True, null=True)
32 class Meta:
33 abstract = True
35 def __str__(self):
36 return self.label
39class E74_Group(models.Model):
40 label = models.CharField(blank=True, default="", max_length=4096)
42 class Meta:
43 abstract = True
45 def __str__(self):
46 return self.label