Skip to content

Commit

Permalink
Merge pull request #228 from acdh-oeaw/211-remodel-relations
Browse files Browse the repository at this point in the history
211 remodel relations
  • Loading branch information
gythaogg authored Dec 10, 2024
2 parents 1c60eb8 + bff448d commit b6777da
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 69 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 5.1.3 on 2024-12-10 10:00

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
(
"apis_ontology",
"0043_remove_workquoteswithoutnametheviewsofperson_relation_ptr_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="versionpersondiscipleofperson_subject_of_teaching_vocab",
name="persondiscipleofperson",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson",
name="history_user",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson",
name="obj_content_type",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson",
name="relation_ptr",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson",
name="subj_content_type",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson_subject_of_teaching_vocab",
name="history",
),
migrations.RemoveField(
model_name="versionpersondiscipleofperson_subject_of_teaching_vocab",
name="subject",
),
migrations.DeleteModel(
name="PersonDiscipleOfPerson",
),
migrations.DeleteModel(
name="VersionPersonDiscipleOfPerson",
),
migrations.DeleteModel(
name="VersionPersonDiscipleOfPerson_subject_of_teaching_vocab",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 5.1.3 on 2024-12-10 10:02

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
(
"apis_ontology",
"0044_remove_versionpersondiscipleofperson_subject_of_teaching_vocab_persondiscipleofperson_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="versionpersonannotatorofinstance",
name="history_user",
),
migrations.RemoveField(
model_name="versionpersonannotatorofinstance",
name="obj_content_type",
),
migrations.RemoveField(
model_name="versionpersonannotatorofinstance",
name="relation_ptr",
),
migrations.RemoveField(
model_name="versionpersonannotatorofinstance",
name="subj_content_type",
),
migrations.DeleteModel(
name="PersonAnnotatorOfInstance",
),
migrations.DeleteModel(
name="VersionPersonAnnotatorOfInstance",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.1.3 on 2024-12-10 10:04

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
(
"apis_ontology",
"0045_remove_versionpersonannotatorofinstance_history_user_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="worknamesperson",
name="relation_ptr",
),
migrations.DeleteModel(
name="VersionWorkNamesPerson",
),
migrations.DeleteModel(
name="WorkNamesPerson",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.1.3 on 2024-12-10 10:06

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("apis_ontology", "0046_remove_worknamesperson_relation_ptr_and_more"),
]

operations = [
migrations.RemoveField(
model_name="worknameswork",
name="relation_ptr",
),
migrations.DeleteModel(
name="VersionWorkNamesWork",
),
migrations.DeleteModel(
name="WorkNamesWork",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 5.1.3 on 2024-12-10 10:07

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("apis_ontology", "0047_remove_worknameswork_relation_ptr_and_more"),
]

operations = [
migrations.RemoveField(
model_name="versionpersonciteswork",
name="history_user",
),
migrations.RemoveField(
model_name="versionpersonciteswork",
name="obj_content_type",
),
migrations.RemoveField(
model_name="versionpersonciteswork",
name="relation_ptr",
),
migrations.RemoveField(
model_name="versionpersonciteswork",
name="subj_content_type",
),
migrations.DeleteModel(
name="PersonCitesWork",
),
migrations.DeleteModel(
name="VersionPersonCitesWork",
),
]
69 changes: 0 additions & 69 deletions apis_ontology/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,19 +457,6 @@ def reverse_name(cls) -> str:
return "biographed by"


class PersonCitesWork(TibScholRelationMixin):
subj_model = Person
obj_model = Work

@classmethod
def name(cls) -> str:
return "cites"

@classmethod
def reverse_name(cls) -> str:
return "is cited by"


class WorkCommentaryOnWork(TibScholRelationMixin):
subj_model = Work
obj_model = Work
Expand Down Expand Up @@ -539,23 +526,6 @@ def reverse_name(cls) -> str:
)


class PersonDiscipleOfPerson(TibScholRelationMixin):
subj_model = Person
obj_model = Person

@classmethod
def name(cls) -> str:
return "disciple of"

@classmethod
def reverse_name(cls) -> str:
return "spiritual teacher of"

subject_of_teaching_vocab = models.ManyToManyField(
Subject, verbose_name="Subject of teaching", blank=True
)


class WorkHasAsAnInstanceInstance(TibScholRelationMixin):
subj_model = Work
obj_model = Instance
Expand Down Expand Up @@ -611,32 +581,6 @@ def reverse_name(cls) -> str:
return "contains"


class WorkNamesPerson(TibScholRelationMixin):
subj_model = Work
obj_model = Person

@classmethod
def name(cls) -> str:
return "names"

@classmethod
def reverse_name(cls) -> str:
return "is named in"


class WorkNamesWork(TibScholRelationMixin):
subj_model = Work
obj_model = Work

@classmethod
def name(cls) -> str:
return "names"

@classmethod
def reverse_name(cls) -> str:
return "is named in"


class PersonOrdinatorOfPerson(TibScholRelationMixin):
subj_model = Person
obj_model = Person
Expand Down Expand Up @@ -874,19 +818,6 @@ def reverse_name(cls) -> str:
return "translated by"


class PersonAnnotatorOfInstance(TibScholRelationMixin):
subj_model = Person
obj_model = Instance

@classmethod
def name(cls) -> str:
return "annotator of"

@classmethod
def reverse_name(cls) -> str:
return "annotated by"


class PersonHasOtherRelationWithInstance(TibScholRelationMixin):
subj_model = Person
obj_model = Instance
Expand Down

0 comments on commit b6777da

Please sign in to comment.