Skip to content

Commit

Permalink
Merge pull request #38 from acdh-oeaw/customise-model
Browse files Browse the repository at this point in the history
Customise model
  • Loading branch information
gythaogg authored Jun 2, 2024
2 parents 55c9f9d + abbfba0 commit e1a9b69
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 4.2.13 on 2024-06-02 21:39

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("apis_ontology", "0010_alter_excerpts_source"),
]

operations = [
migrations.RemoveField(
model_name="place",
name="end_date",
),
migrations.RemoveField(
model_name="place",
name="end_end_date",
),
migrations.RemoveField(
model_name="place",
name="end_start_date",
),
migrations.RemoveField(
model_name="versionplace",
name="end_date",
),
migrations.RemoveField(
model_name="versionplace",
name="end_end_date",
),
migrations.RemoveField(
model_name="versionplace",
name="end_start_date",
),
]
63 changes: 63 additions & 0 deletions apis_ontology/migrations/0012_remove_instance_end_date_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generated by Django 4.2.13 on 2024-06-02 21:42

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
(
"apis_ontology",
"0011_remove_place_end_date_remove_place_end_end_date_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="instance",
name="end_date",
),
migrations.RemoveField(
model_name="instance",
name="end_end_date",
),
migrations.RemoveField(
model_name="instance",
name="end_start_date",
),
migrations.RemoveField(
model_name="versioninstance",
name="end_date",
),
migrations.RemoveField(
model_name="versioninstance",
name="end_end_date",
),
migrations.RemoveField(
model_name="versioninstance",
name="end_start_date",
),
migrations.RemoveField(
model_name="versionwork",
name="end_date",
),
migrations.RemoveField(
model_name="versionwork",
name="end_end_date",
),
migrations.RemoveField(
model_name="versionwork",
name="end_start_date",
),
migrations.RemoveField(
model_name="work",
name="end_date",
),
migrations.RemoveField(
model_name="work",
name="end_end_date",
),
migrations.RemoveField(
model_name="work",
name="end_start_date",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 4.2.13 on 2024-06-02 21:44

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("apis_ontology", "0012_remove_instance_end_date_and_more"),
]

operations = [
migrations.RemoveField(
model_name="instance",
name="published",
),
migrations.RemoveField(
model_name="person",
name="published",
),
migrations.RemoveField(
model_name="place",
name="published",
),
migrations.RemoveField(
model_name="versioninstance",
name="published",
),
migrations.RemoveField(
model_name="versionperson",
name="published",
),
migrations.RemoveField(
model_name="versionplace",
name="published",
),
migrations.RemoveField(
model_name="versionwork",
name="published",
),
migrations.RemoveField(
model_name="work",
name="published",
),
]
15 changes: 13 additions & 2 deletions apis_ontology/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Meta:
"standards.",
)
notes = models.TextField(blank=True, null=True, verbose_name="Notes")
published = models.BooleanField(default=False)
# published = models.BooleanField(default=False)
collection = models.ManyToManyField("apis_metainfo.Collection", editable=False)

@classmethod
Expand Down Expand Up @@ -77,7 +77,7 @@ class Meta:
verbose_name_plural = _("Persons")

def __str__(self):
return f"{RootObject.objects_inheritance.get_subclass(pk=self.pk).name} ({self.pk})"
return f"{self.name} ({self.pk})"


class Place(
Expand All @@ -89,6 +89,9 @@ class Place(
AbstractEntity,
):
class_uri = "http://id.loc.gov/ontologies/bibframe/Place"
end_date = None
end_start_date = None
end_end_date = None

class Meta:
verbose_name = _("place")
Expand All @@ -102,6 +105,10 @@ class Work(
VersionMixin, LegacyStuffMixin, LegacyDateMixin, TibScholEntityMixin, AbstractEntity
):
class_uri = "http://id.loc.gov/ontologies/bibframe/Work"
end_date = None
end_start_date = None
end_end_date = None

LANGUAGES = [
("Sanskrit", "Sanskrit"),
("Tibetan", "Tibetan"),
Expand Down Expand Up @@ -145,6 +152,10 @@ class Instance(
VersionMixin, LegacyStuffMixin, LegacyDateMixin, TibScholEntityMixin, AbstractEntity
):
class_uri = "http://id.loc.gov/ontologies/bibframe/Instance"
end_date = None
end_start_date = None
end_end_date = None

SETS = [
("Set 1", "Set 1"),
("Set 2", "Set 2"),
Expand Down

0 comments on commit e1a9b69

Please sign in to comment.