From 92daa0c51cbe83a1eda456c7c32a8bdeeb9c9661 Mon Sep 17 00:00:00 2001 From: Burathar Date: Sat, 25 Sep 2021 12:57:45 +0200 Subject: [PATCH] Fix property key when creating RecursiveProperty from dict --- biscd/biscd/models/recursive_property.py | 4 ++++ biscd/biscd/models/yaml_serializable.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/biscd/biscd/models/recursive_property.py b/biscd/biscd/models/recursive_property.py index 5dd43bb..191325f 100644 --- a/biscd/biscd/models/recursive_property.py +++ b/biscd/biscd/models/recursive_property.py @@ -34,4 +34,8 @@ class RecursiveProperty: # Fill instance with dict recursive_property.__dict__ = property_dict + + # Add property_key as property, because previous line removed it. + recursive_property.property_key = property_key + return recursive_property diff --git a/biscd/biscd/models/yaml_serializable.py b/biscd/biscd/models/yaml_serializable.py index 34cecbf..684a347 100644 --- a/biscd/biscd/models/yaml_serializable.py +++ b/biscd/biscd/models/yaml_serializable.py @@ -21,7 +21,7 @@ class YamlSerializable(RecursiveProperty): required_attributes = ['name'] def __init__(self): - self.property_key='name' + super().__init__('name') @classmethod #@property