You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@lafrech I'm happy to take look, if you think it can be managed by somebody with no contributions to this project yet.
The _bind_to_schema seems to be the right place. However, how would you manage the typing? The data_key must still be defined as optional, because it will be potential None till it's bindend.
The intention of this issue is, to get rid of the optional
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 theField.data_key
attribute which is defined asstr | 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?
The text was updated successfully, but these errors were encountered: