diff --git a/lib/dl_attrs_model_mapper/dl_attrs_model_mapper/pretty_repr.py b/lib/dl_attrs_model_mapper/dl_attrs_model_mapper/pretty_repr.py index 88119dc83..c16723755 100644 --- a/lib/dl_attrs_model_mapper/dl_attrs_model_mapper/pretty_repr.py +++ b/lib/dl_attrs_model_mapper/dl_attrs_model_mapper/pretty_repr.py @@ -11,6 +11,7 @@ ) import attr +from dynamic_enum import DynamicEnum from dl_attrs_model_mapper.structs.mappings import FrozenMappingStrToStrOrStrSeq from dl_attrs_model_mapper.structs.singleormultistring import SingleOrMultiString @@ -97,6 +98,10 @@ def _get_lines_internal_primitive(self, model: Union[int, float, str, None]) -> def _get_lines_internal_enum(self, model: enum.Enum) -> list[str]: return [f"{self.get_type_str(type(model))}.{model.name}"] + @_get_lines_internal.register + def _get_lines_internal_dyn_enum(self, model: DynamicEnum) -> list[str]: + return [f'{self.get_type_str(type(model))}("{model.name}")'] + @_get_lines_internal.register def _get_lines_internal_list(self, model: list) -> list[str]: return self._get_lines_for_simple_collection(