diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-06 11:20:52 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-06 11:20:52 +0200 |
commit | b095faf494f3b8599f22db27ec19d12fa8508037 (patch) | |
tree | 445db0a06f6bb425b81e4902f4e796ae9d7cf54b /ishtar_common/serializers.py | |
parent | 7722226080b8a248a7e63699fe01e64466011253 (diff) | |
download | Ishtar-b095faf494f3b8599f22db27ec19d12fa8508037.tar.bz2 Ishtar-b095faf494f3b8599f22db27ec19d12fa8508037.zip |
Serializers: test all types
Diffstat (limited to 'ishtar_common/serializers.py')
-rw-r--r-- | ishtar_common/serializers.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ishtar_common/serializers.py b/ishtar_common/serializers.py index 409051ec0..8dca370f5 100644 --- a/ishtar_common/serializers.py +++ b/ishtar_common/serializers.py @@ -166,7 +166,7 @@ def generic_get_results(model_list, dirname, no_geo=True, new_result += result_to_add result[key] = json.dumps(new_result, indent=2) - excluded_fields = ["history_modifier", "history_creator"] + excluded_fields = ["history_modifier", "history_creator", "imports"] if hasattr(model, "SERIALIZATION_EXCLUDE"): excluded_fields = list(model.SERIALIZATION_EXCLUDE) if no_geo: @@ -206,11 +206,15 @@ def generic_archive_files(model_list, archive_name=None): return archive_name +TYPE_MODEL_EXCLUDE = ["Area", "OperationTypeOld"] + + def type_serialization(archive=False, return_empty_types=False, archive_name=None): TYPE_MODEL_LIST = [ model for model in apps.get_models() - if isinstance(model(), models.GeneralType) + if isinstance(model(), models.GeneralType) and ( + model.__name__ not in TYPE_MODEL_EXCLUDE) ] result = generic_get_results(TYPE_MODEL_LIST, "types") return archive_serialization(result, archive_dir="types", archive=archive, @@ -261,7 +265,7 @@ def importer_serialization(archive=False, return_empty_types=False, GEO_MODEL_LIST = [ - models.State, models.Department, models.Town + models.State, models.Department, models.Town, models.Area ] |