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

1from django.db import models 

2 

3######################### 

4# Abstract base classes # 

5######################### 

6 

7 

8# These abstract base classes are named after 

9# CIDOC CRM entities, but we are *NOT*(!) 

10# trying to implement CIDOC CRM in Django. 

11 

12 

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) 

19 

20 class Meta: 

21 abstract = True 

22 

23 def __str__(self): 

24 return f"{self.forename} {self.surname}" 

25 

26 

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) 

31 

32 class Meta: 

33 abstract = True 

34 

35 def __str__(self): 

36 return self.label 

37 

38 

39class E74_Group(models.Model): 

40 label = models.CharField(blank=True, default="", max_length=4096) 

41 

42 class Meta: 

43 abstract = True 

44 

45 def __str__(self): 

46 return self.label