From 975b971ae6efacbd5614be7f057f32d7c302966b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Nov 2020 11:26:55 +0100 Subject: Documents: dynamic filter of support and medium by document type - collapse related fields on edition --- ishtar_common/admin.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'ishtar_common/admin.py') 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') -- cgit v1.2.3