Exclude field from `dataclass.astuple`

Viewed 691

Is there a way to exclude a field from being returned by dataclass.astuple?

For example:

    @dataclass
    class Test:
        int_field: int
        string_field: str
        list_field: list

You can use astuple to write to the database but list_field should be excluded since it would be written in a different manner.

0 Answers
Related