diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-12-07 23:38:28 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:22 +0100 | 
| commit | 3cabe852ae1c568ac19837b16ad7b29bc9a4bd75 (patch) | |
| tree | 9b5aa1c1e963e5f8ae18de176af129be3f179917 | |
| parent | ede8909f935ec2fec2763d2f2e8289bb2f2ecf8d (diff) | |
| download | Ishtar-3cabe852ae1c568ac19837b16ad7b29bc9a4bd75.tar.bz2 Ishtar-3cabe852ae1c568ac19837b16ad7b29bc9a4bd75.zip  | |
Fix: gender type for title type
| -rw-r--r-- | ishtar_common/admin.py | 7 | ||||
| -rw-r--r-- | ishtar_common/migrations/0207_auto_20201207_2337.py | 24 | ||||
| -rw-r--r-- | ishtar_common/models.py | 4 | 
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:  | 
