From a9c7a217383ead98acc4fd55d635c58f1aad9c26 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 7 Sep 2023 18:42:55 +0200 Subject: ✨ Admin - Importers groups: JSON export, adapt JSON export of importer types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/serializers_utils.py | 57 ++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 9 deletions(-) (limited to 'ishtar_common/serializers_utils.py') diff --git a/ishtar_common/serializers_utils.py b/ishtar_common/serializers_utils.py index eefbfd681..ada0a62cf 100644 --- a/ishtar_common/serializers_utils.py +++ b/ishtar_common/serializers_utils.py @@ -115,20 +115,59 @@ def archive_serialization( GENERIC_QUERYSET_FILTER = { "JsonDataSection": {"JsonDataField": "json_data_field__pk__in"}, - "Regexp": {"ImporterType": "columns__importer_type__pk__in"}, + "Regexp": { + "ImporterType": "columns__importer_type__pk__in", + "ImporterGroup": "columns__importer_type__groups__group__pk__in", + }, "ImporterModel": { "ImporterType": [ "importer_type_associated__pk__in", "importer_type_created__pk__in", - ] + ], + "ImporterGroup": [ + "importer_type_associated__groups__group__pk__in", + "importer_type_created__groups__group__pk__in", + ], + }, + "ValueFormater": { + "ImporterType": "columns__importer_type__pk__in", + "ImporterGroup": "columns__importer_type__groups__group__pk__in", + }, + "ImporterColumn": { + "ImporterType": "importer_type__pk__in", + "ImporterGroup": "importer_type__groups__group__pk__in", + }, + "ImporterDefault": { + "ImporterType": "importer_type__pk__in", + "ImporterGroup": "importer_type__groups__group__pk__in", + }, + "ImportTarget": { + "ImporterType": "column__importer_type__pk__in", + "ImporterGroup": "column__importer_type__groups__group__pk__in", }, - "ValueFormater": {"ImporterType": "columns__importer_type__pk__in"}, - "ImporterColumn": {"ImporterType": "importer_type__pk__in"}, - "ImporterDefault": {"ImporterType": "importer_type__pk__in"}, - "ImportTarget": {"ImporterType": "column__importer_type__pk__in"}, - "FormaterType": {"ImporterType": "targets__column__importer_type__pk__in"}, - "ImporterDefaultValues": {"ImporterType": "default_target__importer_type__pk__in"}, - "ImporterDuplicateField": {"ImporterType": "column__importer_type__pk__in"}, + "FormaterType": { + "ImporterType": "targets__column__importer_type__pk__in", + "ImporterGroup": "targets__column__importer_type__groups__group__pk__in", + }, + "ImporterDefaultValues": { + "ImporterType": "default_target__importer_type__pk__in", + "ImporterGroup": "default_target__importer_type__groups__group__pk__in", + }, + "ImporterDuplicateField": { + "ImporterType": "column__importer_type__pk__in", + "ImporterGroup": "column__importer_type__groups__group__pk__in", + }, + "ImporterGroup": { + "ImporterType": "importer_types__importer_type__pk__in", + "ImporterGroup": "importer_types__importer_type__groups__group__pk__in", + }, + "ImporterGroupImporter": { + "ImporterType": "importer_type__pk__in", + "ImporterGroup": "group__pk__in", + }, + "ImporterType": { + "ImporterGroup": "groups__group__pk__in", + } } -- cgit v1.2.3