When inheriting a DTO factory class, there is no way to merge the config of the inherited type with a config defined on the new class.
One idea is to have a callback method on AbstractDTO that handles the case where a 2nd config object is found in the mro of the DTO type.. something like:
class AbstractDTO:
...
@staticmethod
def merge_configs(old: DTOConfig, new: DTOConfig) -> DTOConfig:
return new
Default would just return the latest one, which would preserve current overwrite behavior, but then you could do something like:
class MyDTO(PydanticDTO[...]):
...
@staticmethod
def merge_configs(old: DTOConfig, new: DTOConfig) -> DTOConfig:
new.rename.update(old.rename)
return new
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too