diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-11-27 11:26:55 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:21 +0100 |
commit | 975b971ae6efacbd5614be7f057f32d7c302966b (patch) | |
tree | 300713d38252ed0fb9d25e48e8499b29523b7985 /ishtar_common/admin.py | |
parent | 30bf32d6768f3c013b44e1ed76d94f9954d6e565 (diff) | |
download | Ishtar-975b971ae6efacbd5614be7f057f32d7c302966b.tar.bz2 Ishtar-975b971ae6efacbd5614be7f057f32d7c302966b.zip |
Documents: dynamic filter of support and medium by document type - collapse related fields on edition
Diffstat (limited to 'ishtar_common/admin.py')
-rw-r--r-- | ishtar_common/admin.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py index b5ff67567..26ceb01cd 100644 --- a/ishtar_common/admin.py +++ b/ishtar_common/admin.py @@ -982,8 +982,8 @@ class GeneralTypeAdmin(ImportActionAdmin, ImportJSONActionAdmin): general_models = [models.OrganizationType, models.SourceType, - models.AuthorType, models.TitleType, models.Format, - models.SupportType, models.PersonType, models.LicenseType, + models.AuthorType, models.TitleType, + models.PersonType, models.LicenseType, models.Language] for model in general_models: admin_site.register(model, GeneralTypeAdmin) @@ -1081,6 +1081,22 @@ class CreateDepartmentActionAdmin(GeneralTypeAdmin): {'form': form, 'current_action': 'create_area'} ) +@admin.register(models.SupportType, site=admin_site) +class SupportType(GeneralTypeAdmin): + model = models.SupportType + form = make_ajax_form(model, {'document_types': 'source_type'}) + + +@admin.register(models.Format, site=admin_site) +class Format(GeneralTypeAdmin): + model = models.Format + form = make_ajax_form(model, {'document_types': 'source_type'}) + + +@admin.register(models.DocumentTag, site=admin_site) +class DocumentTag(MergeActionAdmin, GeneralTypeAdmin): + pass + class AreaAdmin(CreateDepartmentActionAdmin): list_display = ('label', 'reference', 'parent', 'available') |