Skip to content

Commit

Permalink
Merge pull request #299 from acdh-oeaw/goodbye-notes
Browse files Browse the repository at this point in the history
Removal of notes field:
apis_ontology/models.py: Removed the notes field from the Meta class.
Updates to filter sets:
apis_ontology/filtersets.py: Removed the notes field from the exclude lists in the Meta classes of PersonFilterSet, PlaceFilterSet, WorkFilterSet, and InstanceFilterSet. [1] [2] [3] [4]
Migration updates:
apis_ontology/migrations/0057_alter_instance_options_alter_person_options_and_more.py: Created a new migration to remove the notes field from the Instance, Person, Place, VersionInstance, VersionPerson, VersionPlace, VersionWork, and Work models, and updated model options and fields.
  • Loading branch information
gythaogg authored Feb 13, 2025
2 parents c64a7c7 + ac70d95 commit 91691dd
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 10 deletions.
8 changes: 0 additions & 8 deletions apis_ontology/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
from apis_ontology.models import Instance, Person, Place, Work
from apis_ontology.utils import get_relevant_relations

ABSTRACT_ENTITY_FILTERS_EXCLUDE = [
f for f in ABSTRACT_ENTITY_FILTERS_EXCLUDE if f != "notes"
]


def filter_related_property(queryset, name, value):
rel_class = apps.get_model("apis_ontology", value)
Expand Down Expand Up @@ -145,7 +141,6 @@ class Meta:
*ABSTRACT_ENTITY_FILTERS_EXCLUDE,
"latitude",
"longitude",
"notes",
"name",
]
form = PlaceSearchForm
Expand Down Expand Up @@ -185,7 +180,6 @@ class PersonFilterSet(TibScholEntityMixinFilterSet):
class Meta:
exclude = [
*ABSTRACT_ENTITY_FILTERS_EXCLUDE,
"notes",
"alternative_names",
]
form = PersonSearchForm
Expand Down Expand Up @@ -225,7 +219,6 @@ class WorkFilterSet(TibScholEntityMixinFilterSet):
class Meta:
exclude = [
*ABSTRACT_ENTITY_FILTERS_EXCLUDE,
"notes",
"alternative_names",
]

Expand Down Expand Up @@ -266,7 +259,6 @@ class InstanceFilterSet(TibScholEntityMixinFilterSet):
class Meta:
exclude = [
*ABSTRACT_ENTITY_FILTERS_EXCLUDE,
"notes",
"alternative_names",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Generated by Django 5.1.6 on 2025-02-13 08:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
(
"apis_ontology",
"0056_rename_placeislocatedwithinplace_placelocatedwithinplace_and_more",
),
]

operations = [
migrations.AlterModelOptions(
name="instance",
options={
"ordering": ["name", "pk"],
"verbose_name": "instance",
"verbose_name_plural": "Instances",
},
),
migrations.AlterModelOptions(
name="person",
options={
"ordering": ["name", "pk"],
"verbose_name": "person",
"verbose_name_plural": "Persons",
},
),
migrations.AlterModelOptions(
name="subject",
options={
"ordering": ["name"],
"verbose_name": "Topic",
"verbose_name_plural": "Topics",
},
),
migrations.AlterModelOptions(
name="work",
options={
"ordering": ["name", "pk"],
"verbose_name": "work",
"verbose_name_plural": "Works",
},
),
migrations.RemoveField(
model_name="instance",
name="notes",
),
migrations.RemoveField(
model_name="person",
name="notes",
),
migrations.RemoveField(
model_name="place",
name="notes",
),
migrations.RemoveField(
model_name="versioninstance",
name="notes",
),
migrations.RemoveField(
model_name="versionperson",
name="notes",
),
migrations.RemoveField(
model_name="versionplace",
name="notes",
),
migrations.RemoveField(
model_name="versionwork",
name="notes",
),
migrations.RemoveField(
model_name="work",
name="notes",
),
migrations.AlterField(
model_name="personactiveatplace",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="personlineagepredecessorofperson",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="personquoteswithnameperson",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="personquoteswithoutnameperson",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="personrequestsperson",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="personstudentofperson",
name="subject_of_teaching_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic of teaching"
),
),
migrations.AlterField(
model_name="work",
name="subject_vocab",
field=models.ManyToManyField(
blank=True, to="apis_ontology.subject", verbose_name="Topic"
),
),
]
2 changes: 0 additions & 2 deletions apis_ontology/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class Meta:
"data record holds up quality "
"standards.",
)
notes = models.TextField(blank=True, null=True, verbose_name="Notes")
# published = models.BooleanField(default=False)
published = None

@classmethod
Expand Down

0 comments on commit 91691dd

Please sign in to comment.