def test_do_dict(self): """ Утилита do_dict конструирует словарь по точечной нотации поля """ self.assertDictEqual({"a": {"b": {"c": 1}}}, do_dict("a.b.c", 1))
def settings(self): if not hasattr(self, "_settings"): self._settings = flexdict() for setting in self.settings_raw: self._settings = merge_dict(self._settings, do_dict(setting.name, setting.value, cls=flexdict), cls=flexdict) return self._settings