summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/admin.py7
-rw-r--r--ishtar_common/migrations/0207_auto_20201207_2337.py24
-rw-r--r--ishtar_common/models.py4
3 files changed, 29 insertions, 6 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py
index 082436dc5..269c12927 100644
--- a/ishtar_common/admin.py
+++ b/ishtar_common/admin.py
@@ -974,13 +974,12 @@ class GeneralTypeAdmin(ImportActionAdmin, ImportJSONActionAdmin):
general_models = [models.SourceType, models.AuthorType, models.LicenseType,
- models.Language]
+ models.Language, models.PersonType]
for model in general_models:
admin_site.register(model, GeneralTypeAdmin)
@admin.register(models.OrganizationType, site=admin_site)
-@admin.register(models.PersonType, site=admin_site)
class PersonTypeAdmin(GeneralTypeAdmin):
LIST_DISPLAY = ['label', 'grammatical_gender', 'txt_idx', 'available',
'comment']
@@ -988,8 +987,8 @@ class PersonTypeAdmin(GeneralTypeAdmin):
@admin.register(models.TitleType, site=admin_site)
class TitleType(GeneralTypeAdmin):
- LIST_DISPLAY = ['label', 'long_title', 'txt_idx', 'available',
- 'comment']
+ LIST_DISPLAY = ['label', 'long_title', 'grammatical_gender', 'txt_idx',
+ 'available', 'comment']
class CreateAreaForm(forms.Form):
diff --git a/ishtar_common/migrations/0207_auto_20201207_2337.py b/ishtar_common/migrations/0207_auto_20201207_2337.py
new file mode 100644
index 000000000..3aa52de32
--- /dev/null
+++ b/ishtar_common/migrations/0207_auto_20201207_2337.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.27 on 2020-12-07 23:37
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0206_auto_20201206_2316'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='persontype',
+ name='grammatical_gender',
+ ),
+ migrations.AddField(
+ model_name='titletype',
+ name='grammatical_gender',
+ field=models.CharField(blank=True, choices=[('M', 'Male'), ('F', 'Female'), ('N', 'Neutral')], default='', max_length=1, verbose_name='Grammatical gender'),
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 0605a961c..ea3bd5ed1 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1799,7 +1799,7 @@ class Organization(Address, Merge, OwnPerms, ValueGetter, MainItem):
post_save.connect(cached_label_changed, sender=Organization)
-class PersonType(GenderedType):
+class PersonType(GeneralType):
class Meta:
verbose_name = _("Person type")
verbose_name_plural = _("Person types")
@@ -1862,7 +1862,7 @@ def get_publisher_label():
return _("Error: publisher type is missing")
-class TitleType(GeneralType):
+class TitleType(GenderedType):
long_title = models.TextField(_("Long title"), default="", blank=True)
class Meta: