Skip to content

feature request: custom serialization for specific column #35

Description

@ivan-ngchakming

Is there any way to specify a custom serialization function for one column by name? Like the serialize_types for custom type, something like

class CustomSerializerMixin(SerializerMixin):
    additional_serialize_rule = (('column1', lambda x: x),)

edit: my current get around is this, but it would be nice if this step could be done during serialization and reduce the redundant logic

class CustomSerializerMixin(SerializerMixin):

    def to_dict(self, *args, **kwargs):
        obj_dict = super().to_dict(*args, **kwargs)

        # ...custom logic to transform obj_dict

        return obj_dict

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions