Skip to content

Always set data_key #1864

Open
Open
@kasium

Description

@kasium

Hello all,

in my application we use and love marshmallow. We have a lot of dynamic coding, therefore we access fields e.g. over the declared_fields attribute. Also we need most of the time the Field.data_key attribute which is defined as str | None.

I would like to suggest an option, which always sets the data_key so that it will never be None. If the user provides it, fine. Else, just set it to the field name. I guess this could also simplify some coding, since you can expect that this attribute is always set.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions