-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apis_entities): implement default abstract entity classes
Closes: #403
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from django.db import models | ||
from apis_core.core.abc import LabelBaseModel | ||
|
||
######################### | ||
# Abstract base classes # | ||
######################### | ||
|
||
|
||
# These abstract base classes are named after | ||
# CIDOC CRM entities, but we are *NOT*(!) | ||
# trying to implement CIDOC CRM in Django. | ||
|
||
|
||
class E21_Person(LabelBaseModel, models.Model): | ||
forename = models.CharField(blank=True, default="") | ||
surname = models.CharField(blank=True, default="") | ||
gender = models.CharField(blank=True, default="") | ||
date_of_birth = models.DateField(blank=True, null=True) | ||
date_of_death = models.DateField(blank=True, null=True) | ||
|
||
class Meta: | ||
abstract = True | ||
|
||
|
||
class E53_Place(LabelBaseModel, models.Model): | ||
longitude = models.FloatField(blank=True, null=True) | ||
latitude = models.FloatField(blank=True, null=True) | ||
|
||
class Meta: | ||
abstract = True | ||
|
||
|
||
class E74_Group(LabelBaseModel, models.Model): | ||
class Meta: | ||
abstract = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.db import models | ||
|
||
|
||
class LabelBaseModel(models.Model): | ||
label = models.CharField(blank=True, default="") | ||
|
||
class Meta: | ||
abstract = True |