Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apis_entities): implement default entity classes #685

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions apis_core/apis_entities/abc.py
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
8 changes: 8 additions & 0 deletions apis_core/core/abc.py
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
Loading