From b14e24d5e15612778e148f0d538389af3c294c0a Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:04:27 +0100 Subject: [PATCH 01/12] remove PersonEditorOfInstance --- ...neditorofinstance_history_user_and_more.py | 34 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0032_remove_versionpersoneditorofinstance_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 17d4e15..ce4824a 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -569,19 +569,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 From 9e267d5232cbe346184b817054ec8c36290c6123 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:07:30 +0100 Subject: [PATCH 02/12] remove PersonIllustratorOfInstance --- ...stratorofinstance_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0033_remove_versionpersonillustratorofinstance_history_user_and_more.py 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/models.py b/apis_ontology/models.py index ce4824a..5cc0aa2 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -621,19 +621,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 From 43a383d41d06a7fc24f4dc4a48fe18201dfefe09 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:08:39 +0100 Subject: [PATCH 03/12] remove PersonLenderOfInstance --- ...nlenderofinstance_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0034_remove_versionpersonlenderofinstance_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 5cc0aa2..4fdac88 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -650,19 +650,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 From 37fff01d767cf0e034f5837a58f2281635e1771f Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:10:02 +0100 Subject: [PATCH 04/12] remove PersonSpiritualFriendOfPerson --- ...ualfriendofperson_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0035_remove_versionpersonspiritualfriendofperson_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 4fdac88..dfc16ae 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -870,19 +870,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 From 787ecb41602c117439900c67aeef9af94cb075fb Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:11:48 +0100 Subject: [PATCH 05/12] remove PersonPromoterOfWork --- ...sonpromoterofwork_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0036_remove_versionpersonpromoterofwork_history_user_and_more.py 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/models.py b/apis_ontology/models.py index dfc16ae..f4bc11d 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -728,19 +728,6 @@ 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 From ecc94ed4984548e027e5ebe7ee3530c747881728 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:12:50 +0100 Subject: [PATCH 06/12] remove PersonPatronOfPerson --- ...sonpatronofperson_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0037_remove_versionpersonpatronofperson_history_user_and_more.py 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/models.py b/apis_ontology/models.py index f4bc11d..23e5fbe 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -715,19 +715,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 PersonPrompterOfWork(TibScholRelationMixin): subj_model = Person obj_model = Work From f2efe6215d5a11087c45c81b5f3617fc7cd448d5 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:13:57 +0100 Subject: [PATCH 07/12] remove PersonFellowStudentOfPerson --- ...owstudentofperson_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0038_remove_versionpersonfellowstudentofperson_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 23e5fbe..641ff3b 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -582,19 +582,6 @@ 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 From d4525d5d979ae1af3dfbd44f7cdb2fdee3d7a938 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:14:46 +0100 Subject: [PATCH 08/12] remove PersonAuntMaternalPaternalOfPerson --- ...lpaternalofperson_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0039_remove_versionpersonauntmaternalpaternalofperson_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 641ff3b..3312baf 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 From e1d135fe618bbda8cb83eeb07329b9fe9ca9f8df Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:15:40 +0100 Subject: [PATCH 09/12] remove PersonFellowMonkOfPerson --- ...ellowmonkofperson_history_user_and_more.py | 37 +++++++++++++++++++ apis_ontology/models.py | 13 ------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0040_remove_versionpersonfellowmonkofperson_history_user_and_more.py 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/models.py b/apis_ontology/models.py index 3312baf..f4de9c2 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -556,19 +556,6 @@ def reverse_name(cls) -> str: ) -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 WorkHasAsAnInstanceInstance(TibScholRelationMixin): subj_model = Work obj_model = Instance From 63f223082f67470311b6bb45270b192faf812ff9 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:19:12 +0100 Subject: [PATCH 10/12] introduce PersonHasOtherRelationWithInstance --- ...onhasotherrelationwithinstance_and_more.py | 246 ++++++++++++++++++ apis_ontology/models.py | 13 + 2 files changed, 259 insertions(+) create mode 100644 apis_ontology/migrations/0041_personhasotherrelationwithinstance_and_more.py 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/models.py b/apis_ontology/models.py index f4de9c2..f34c5d2 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -911,3 +911,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" From 2bbcb21762f4047c30b72556a4a086f0081c3430 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:20:03 +0100 Subject: [PATCH 11/12] remove WorkQuotesWithNameTheViewsOfPerson --- ...etheviewsofperson_relation_ptr_and_more.py | 22 +++++++++++++++++++ apis_ontology/models.py | 13 ----------- 2 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0042_remove_workquoteswithnametheviewsofperson_relation_ptr_and_more.py 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/models.py b/apis_ontology/models.py index f34c5d2..4d8cc01 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -689,19 +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 From 4b5789cb6a192c4ca27369e9d38730e6c3c314c4 Mon Sep 17 00:00:00 2001 From: Gytha Ogg Date: Wed, 4 Dec 2024 12:21:08 +0100 Subject: [PATCH 12/12] remove WorkQuotesWithoutNameTheViewsOfPerson --- ...etheviewsofperson_relation_ptr_and_more.py | 25 +++++++++++++++++++ apis_ontology/models.py | 13 ---------- 2 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 apis_ontology/migrations/0043_remove_workquoteswithoutnametheviewsofperson_relation_ptr_and_more.py 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 4d8cc01..4d2af67 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -689,19 +689,6 @@ def reverse_name(cls) -> str: return "prompted by" -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