diff --git a/apis_ontology/migrations/0032_remove_versionpersoneditorofinstance_history_user_and_more.py b/apis_ontology/migrations/0032_remove_versionpersoneditorofinstance_history_user_and_more.py new file mode 100644 index 0000000..0d18020 --- /dev/null +++ b/apis_ontology/migrations/0032_remove_versionpersoneditorofinstance_history_user_and_more.py @@ -0,0 +1,34 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("apis_ontology", "0031_versioninstancecopiedwrittendownatplace_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersoneditorofinstance", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersoneditorofinstance", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersoneditorofinstance", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersoneditorofinstance", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonEditorOfInstance", + ), + migrations.DeleteModel( + name="VersionPersonEditorOfInstance", + ), + ] diff --git a/apis_ontology/migrations/0033_remove_versionpersonillustratorofinstance_history_user_and_more.py b/apis_ontology/migrations/0033_remove_versionpersonillustratorofinstance_history_user_and_more.py new file mode 100644 index 0000000..52794ab --- /dev/null +++ b/apis_ontology/migrations/0033_remove_versionpersonillustratorofinstance_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:07 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0032_remove_versionpersoneditorofinstance_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonillustratorofinstance", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonillustratorofinstance", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonillustratorofinstance", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonillustratorofinstance", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonIllustratorOfInstance", + ), + migrations.DeleteModel( + name="VersionPersonIllustratorOfInstance", + ), + ] diff --git a/apis_ontology/migrations/0034_remove_versionpersonlenderofinstance_history_user_and_more.py b/apis_ontology/migrations/0034_remove_versionpersonlenderofinstance_history_user_and_more.py new file mode 100644 index 0000000..a834754 --- /dev/null +++ b/apis_ontology/migrations/0034_remove_versionpersonlenderofinstance_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:08 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0033_remove_versionpersonillustratorofinstance_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonlenderofinstance", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonlenderofinstance", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonlenderofinstance", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonlenderofinstance", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonLenderOfInstance", + ), + migrations.DeleteModel( + name="VersionPersonLenderOfInstance", + ), + ] diff --git a/apis_ontology/migrations/0035_remove_versionpersonspiritualfriendofperson_history_user_and_more.py b/apis_ontology/migrations/0035_remove_versionpersonspiritualfriendofperson_history_user_and_more.py new file mode 100644 index 0000000..5f90fe6 --- /dev/null +++ b/apis_ontology/migrations/0035_remove_versionpersonspiritualfriendofperson_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0034_remove_versionpersonlenderofinstance_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonspiritualfriendofperson", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonspiritualfriendofperson", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonspiritualfriendofperson", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonspiritualfriendofperson", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonSpiritualFriendOfPerson", + ), + migrations.DeleteModel( + name="VersionPersonSpiritualFriendOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0036_remove_versionpersonpromoterofwork_history_user_and_more.py b/apis_ontology/migrations/0036_remove_versionpersonpromoterofwork_history_user_and_more.py new file mode 100644 index 0000000..d39d652 --- /dev/null +++ b/apis_ontology/migrations/0036_remove_versionpersonpromoterofwork_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:11 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0035_remove_versionpersonspiritualfriendofperson_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonpromoterofwork", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonpromoterofwork", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonpromoterofwork", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonpromoterofwork", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonPromoterOfWork", + ), + migrations.DeleteModel( + name="VersionPersonPromoterOfWork", + ), + ] diff --git a/apis_ontology/migrations/0037_remove_versionpersonpatronofperson_history_user_and_more.py b/apis_ontology/migrations/0037_remove_versionpersonpatronofperson_history_user_and_more.py new file mode 100644 index 0000000..d3625d0 --- /dev/null +++ b/apis_ontology/migrations/0037_remove_versionpersonpatronofperson_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:12 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0036_remove_versionpersonpromoterofwork_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonpatronofperson", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonpatronofperson", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonpatronofperson", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonpatronofperson", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonPatronOfPerson", + ), + migrations.DeleteModel( + name="VersionPersonPatronOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0038_remove_versionpersonfellowstudentofperson_history_user_and_more.py b/apis_ontology/migrations/0038_remove_versionpersonfellowstudentofperson_history_user_and_more.py new file mode 100644 index 0000000..d2bc59e --- /dev/null +++ b/apis_ontology/migrations/0038_remove_versionpersonfellowstudentofperson_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:13 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0037_remove_versionpersonpatronofperson_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonfellowstudentofperson", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonfellowstudentofperson", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonfellowstudentofperson", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonfellowstudentofperson", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonFellowStudentOfPerson", + ), + migrations.DeleteModel( + name="VersionPersonFellowStudentOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0039_remove_versionpersonauntmaternalpaternalofperson_history_user_and_more.py b/apis_ontology/migrations/0039_remove_versionpersonauntmaternalpaternalofperson_history_user_and_more.py new file mode 100644 index 0000000..5a68885 --- /dev/null +++ b/apis_ontology/migrations/0039_remove_versionpersonauntmaternalpaternalofperson_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:14 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0038_remove_versionpersonfellowstudentofperson_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonauntmaternalpaternalofperson", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonauntmaternalpaternalofperson", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonauntmaternalpaternalofperson", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonauntmaternalpaternalofperson", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonAuntMaternalPaternalOfPerson", + ), + migrations.DeleteModel( + name="VersionPersonAuntMaternalPaternalOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0040_remove_versionpersonfellowmonkofperson_history_user_and_more.py b/apis_ontology/migrations/0040_remove_versionpersonfellowmonkofperson_history_user_and_more.py new file mode 100644 index 0000000..5d0ae00 --- /dev/null +++ b/apis_ontology/migrations/0040_remove_versionpersonfellowmonkofperson_history_user_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:15 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0039_remove_versionpersonauntmaternalpaternalofperson_history_user_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="versionpersonfellowmonkofperson", + name="history_user", + ), + migrations.RemoveField( + model_name="versionpersonfellowmonkofperson", + name="obj_content_type", + ), + migrations.RemoveField( + model_name="versionpersonfellowmonkofperson", + name="relation_ptr", + ), + migrations.RemoveField( + model_name="versionpersonfellowmonkofperson", + name="subj_content_type", + ), + migrations.DeleteModel( + name="PersonFellowMonkOfPerson", + ), + migrations.DeleteModel( + name="VersionPersonFellowMonkOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0041_personhasotherrelationwithinstance_and_more.py b/apis_ontology/migrations/0041_personhasotherrelationwithinstance_and_more.py new file mode 100644 index 0000000..c3f6bee --- /dev/null +++ b/apis_ontology/migrations/0041_personhasotherrelationwithinstance_and_more.py @@ -0,0 +1,246 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:18 + +import apis_core.generic.abc +import django.db.models.deletion +import simple_history.models +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0040_remove_versionpersonfellowmonkofperson_history_user_and_more", + ), + ("contenttypes", "0002_remove_content_type_name"), + ("relations", "0001_initial"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="PersonHasOtherRelationWithInstance", + fields=[ + ( + "relation_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="relations.relation", + ), + ), + ("start_date", models.DateField(blank=True, editable=False, null=True)), + ( + "start_start_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "start_end_date", + models.DateField(blank=True, editable=False, null=True), + ), + ("end_date", models.DateField(blank=True, editable=False, null=True)), + ( + "end_start_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "end_end_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "start_date_written", + models.CharField( + blank=True, max_length=255, null=True, verbose_name="Start" + ), + ), + ( + "end_date_written", + models.CharField( + blank=True, max_length=255, null=True, verbose_name="End" + ), + ), + ( + "zotero_refs", + models.TextField(blank=True, null=True, verbose_name="Zotero"), + ), + ( + "tei_refs", + models.TextField(blank=True, null=True, verbose_name="Excerpts"), + ), + ( + "support_notes", + models.TextField( + blank=True, null=True, verbose_name="Support notes" + ), + ), + ( + "confidence", + models.CharField( + blank=True, + choices=[ + ("Positive", "Positive"), + ("Uncertain", "Uncertain"), + ("Negative", "Negative"), + ], + default="Positive", + max_length=1000, + null=True, + verbose_name="Confidence", + ), + ), + ], + options={ + "abstract": False, + }, + bases=( + "relations.relation", + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + migrations.CreateModel( + name="VersionPersonHasOtherRelationWithInstance", + fields=[ + ( + "relation_ptr", + models.ForeignKey( + auto_created=True, + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + parent_link=True, + related_name="+", + to="relations.relation", + ), + ), + ( + "id", + models.IntegerField( + auto_created=True, blank=True, db_index=True, verbose_name="ID" + ), + ), + ("subj_object_id", models.PositiveIntegerField()), + ("obj_object_id", models.PositiveIntegerField()), + ("start_date", models.DateField(blank=True, editable=False, null=True)), + ( + "start_start_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "start_end_date", + models.DateField(blank=True, editable=False, null=True), + ), + ("end_date", models.DateField(blank=True, editable=False, null=True)), + ( + "end_start_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "end_end_date", + models.DateField(blank=True, editable=False, null=True), + ), + ( + "start_date_written", + models.CharField( + blank=True, max_length=255, null=True, verbose_name="Start" + ), + ), + ( + "end_date_written", + models.CharField( + blank=True, max_length=255, null=True, verbose_name="End" + ), + ), + ( + "version_tag", + models.CharField(blank=True, max_length=255, null=True), + ), + ( + "zotero_refs", + models.TextField(blank=True, null=True, verbose_name="Zotero"), + ), + ( + "tei_refs", + models.TextField(blank=True, null=True, verbose_name="Excerpts"), + ), + ( + "support_notes", + models.TextField( + blank=True, null=True, verbose_name="Support notes" + ), + ), + ( + "confidence", + models.CharField( + blank=True, + choices=[ + ("Positive", "Positive"), + ("Uncertain", "Uncertain"), + ("Negative", "Negative"), + ], + default="Positive", + max_length=1000, + null=True, + verbose_name="Confidence", + ), + ), + ("history_id", models.AutoField(primary_key=True, serialize=False)), + ("history_date", models.DateTimeField(db_index=True)), + ("history_change_reason", models.CharField(max_length=100, null=True)), + ( + "history_type", + models.CharField( + choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], + max_length=1, + ), + ), + ( + "history_user", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "obj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ( + "subj_content_type", + models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "historical person has other relation with instance", + "verbose_name_plural": "historical person has other relation with instances", + "ordering": ("-history_date", "-history_id"), + "get_latest_by": ("history_date", "history_id"), + }, + bases=( + simple_history.models.HistoricalChanges, + models.Model, + apis_core.generic.abc.GenericModel, + ), + ), + ] diff --git a/apis_ontology/migrations/0042_remove_workquoteswithnametheviewsofperson_relation_ptr_and_more.py b/apis_ontology/migrations/0042_remove_workquoteswithnametheviewsofperson_relation_ptr_and_more.py new file mode 100644 index 0000000..2f67cfa --- /dev/null +++ b/apis_ontology/migrations/0042_remove_workquoteswithnametheviewsofperson_relation_ptr_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:19 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("apis_ontology", "0041_personhasotherrelationwithinstance_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="workquoteswithnametheviewsofperson", + name="relation_ptr", + ), + migrations.DeleteModel( + name="VersionWorkQuotesWithNameTheViewsOfPerson", + ), + migrations.DeleteModel( + name="WorkQuotesWithNameTheViewsOfPerson", + ), + ] diff --git a/apis_ontology/migrations/0043_remove_workquoteswithoutnametheviewsofperson_relation_ptr_and_more.py b/apis_ontology/migrations/0043_remove_workquoteswithoutnametheviewsofperson_relation_ptr_and_more.py new file mode 100644 index 0000000..90be873 --- /dev/null +++ b/apis_ontology/migrations/0043_remove_workquoteswithoutnametheviewsofperson_relation_ptr_and_more.py @@ -0,0 +1,25 @@ +# Generated by Django 5.1.3 on 2024-12-04 11:20 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ( + "apis_ontology", + "0042_remove_workquoteswithnametheviewsofperson_relation_ptr_and_more", + ), + ] + + operations = [ + migrations.RemoveField( + model_name="workquoteswithoutnametheviewsofperson", + name="relation_ptr", + ), + migrations.DeleteModel( + name="VersionWorkQuotesWithoutNameTheViewsOfPerson", + ), + migrations.DeleteModel( + name="WorkQuotesWithoutNameTheViewsOfPerson", + ), + ] diff --git a/apis_ontology/models.py b/apis_ontology/models.py index 17d4e15..4d2af67 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -418,19 +418,6 @@ def reverse_name(cls) -> str: return "addressed to" -class PersonAuntMaternalPaternalOfPerson(TibScholRelationMixin): - subj_model = Person - obj_model = Person - - @classmethod - def name(cls) -> str: - return "aunt (maternal/paternal) of" - - @classmethod - def reverse_name(cls) -> str: - return "nephew (maternal/paternal) of" - - class PersonAuthorOfWork(TibScholRelationMixin): subj_model = Person obj_model = Work @@ -569,45 +556,6 @@ def reverse_name(cls) -> str: ) -class PersonEditorOfInstance(TibScholRelationMixin): - subj_model = Person - obj_model = Instance - - @classmethod - def name(cls) -> str: - return "editor of" - - @classmethod - def reverse_name(cls) -> str: - return "edited by" - - -class PersonFellowMonkOfPerson(TibScholRelationMixin): - subj_model = Person - obj_model = Person - - @classmethod - def name(cls) -> str: - return "fellow monk of" - - @classmethod - def reverse_name(cls) -> str: - return "fellow monk of" - - -class PersonFellowStudentOfPerson(TibScholRelationMixin): - subj_model = Person - obj_model = Person - - @classmethod - def name(cls) -> str: - return "fellow student of" - - @classmethod - def reverse_name(cls) -> str: - return "fellow student of" - - class WorkHasAsAnInstanceInstance(TibScholRelationMixin): subj_model = Work obj_model = Instance @@ -634,19 +582,6 @@ def reverse_name(cls) -> str: return "has other type of personal relation to" -class PersonIllustratorOfInstance(TibScholRelationMixin): - subj_model = Person - obj_model = Instance - - @classmethod - def name(cls) -> str: - return "illustrator of" - - @classmethod - def reverse_name(cls) -> str: - return "illustrated by" - - class InstanceIsCopiedFromInstance(TibScholRelationMixin): subj_model = Instance obj_model = Instance @@ -676,19 +611,6 @@ def reverse_name(cls) -> str: return "contains" -class PersonLenderOfInstance(TibScholRelationMixin): - subj_model = Person - obj_model = Instance - - @classmethod - def name(cls) -> str: - return "lender of" - - @classmethod - def reverse_name(cls) -> str: - return "lent by" - - class WorkNamesPerson(TibScholRelationMixin): subj_model = Work obj_model = Person @@ -754,32 +676,6 @@ def reverse_name(cls) -> str: return "child of" -class PersonPatronOfPerson(TibScholRelationMixin): - subj_model = Person - obj_model = Person - - @classmethod - def name(cls) -> str: - return "patron of" - - @classmethod - def reverse_name(cls) -> str: - return "protegee of" - - -class PersonPromoterOfWork(TibScholRelationMixin): - subj_model = Person - obj_model = Work - - @classmethod - def name(cls) -> str: - return "promoter of" - - @classmethod - def reverse_name(cls) -> str: - return "promoted by" - - class PersonPrompterOfWork(TibScholRelationMixin): subj_model = Person obj_model = Work @@ -793,32 +689,6 @@ def reverse_name(cls) -> str: return "prompted by" -class WorkQuotesWithNameTheViewsOfPerson(TibScholRelationMixin): - subj_model = Work - obj_model = Person - - @classmethod - def name(cls) -> str: - return "quotes (with name) the views of" - - @classmethod - def reverse_name(cls) -> str: - return "has views quoted (with name) in" - - -class WorkQuotesWithoutNameTheViewsOfPerson(TibScholRelationMixin): - subj_model = Work - obj_model = Person - - @classmethod - def name(cls) -> str: - return "quotes (without name) the views of" - - @classmethod - def reverse_name(cls) -> str: - return "has views quoted (without name) in" - - class WorkRecordsTheTeachingOfPerson(TibScholRelationMixin): subj_model = Work obj_model = Person @@ -909,19 +779,6 @@ def reverse_name(cls) -> str: return "sibling of" -class PersonSpiritualFriendOfPerson(TibScholRelationMixin): - subj_model = Person - obj_model = Person - - @classmethod - def name(cls) -> str: - return "spiritual friend of" - - @classmethod - def reverse_name(cls) -> str: - return "has as spiritual friend" - - class PersonSponsorOfInstance(TibScholRelationMixin): subj_model = Person obj_model = Instance @@ -1028,3 +885,16 @@ def name(cls) -> str: @classmethod def reverse_name(cls) -> str: return "annotated by" + + +class PersonHasOtherRelationWithInstance(TibScholRelationMixin): + subj_model = Person + obj_model = Instance + + @classmethod + def name(cls) -> str: + return "has other relation with" + + @classmethod + def reverse_name(cls) -> str: + return "has other relation with"