From 010829108e1d88d3662afd1d5f00d63b08bbef99 Mon Sep 17 00:00:00 2001 From: KK Date: Thu, 21 Mar 2024 17:51:53 +0100 Subject: [PATCH 1/2] feat(models): add mixin for internal notes --- apis_ontology/models.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apis_ontology/models.py b/apis_ontology/models.py index 9f8c7e9..6bb28d0 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -35,6 +35,23 @@ class Meta: verbose_name_plural = _("progress states") +class NotesMixin(models.Model): + """ + Mixin for internal notes. + """ + + notes = models.TextField( + max_length=1024, + blank=True, + default="", + verbose_name=_("Notiz"), + help_text=_("Feld für interne Notizen"), + ) + + class Meta: + abstract = True + + @reversion.register class AlternativeNameMixin(models.Model): """ From 226a285a9fd60a0887cb68630776c524f644a2e0 Mon Sep 17 00:00:00 2001 From: KK Date: Mon, 25 Mar 2024 09:06:11 +0100 Subject: [PATCH 2/2] feat(models): add NotesMixin to Expression --- .../migrations/0044_expression_notes.py | 23 +++++++++++++++++++ apis_ontology/models.py | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 apis_ontology/migrations/0044_expression_notes.py diff --git a/apis_ontology/migrations/0044_expression_notes.py b/apis_ontology/migrations/0044_expression_notes.py new file mode 100644 index 0000000..6749f39 --- /dev/null +++ b/apis_ontology/migrations/0044_expression_notes.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-03-25 08:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("apis_ontology", "0043_rename_first_name_character_forename_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="expression", + name="notes", + field=models.TextField( + blank=True, + default="", + help_text="Feld für interne Notizen", + max_length=1024, + verbose_name="Notiz", + ), + ), + ] diff --git a/apis_ontology/models.py b/apis_ontology/models.py index 6bb28d0..9d844cc 100644 --- a/apis_ontology/models.py +++ b/apis_ontology/models.py @@ -507,7 +507,9 @@ class Meta: @reversion.register(follow=["rootobject_ptr"]) -class Expression(TitlesMixin, DescriptionMixin, StatusMixin, AbstractEntity): +class Expression( + TitlesMixin, DescriptionMixin, NotesMixin, StatusMixin, AbstractEntity +): """ A concrete representation of a given Work, captured in signs, images, audio signals,...