-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wider config scopes #139
Comments
Is this issue up-for-grabs? I would love to tackle this, because it would really help my use case |
@MichaelAzimov sorry for not getting back to you on this. There currently is undocumented global config functionality (mainly because it's pretty experimental). For example: from datetime import date
import dataclasses_json.cfg
dataclasses_json.cfg.global_config.encoders[date] = date.isoformat
dataclasses_json.cfg.global_config.decoders[date] = date.fromisoformat |
Note: dataclasses_json.cfg.global_config.encoders[date|None] = lambda x: x and date.isoformat(x) otherwise you still get the |
Sharing encoder / decoder in wider scopes (currently must be per-field. type, class, global are all potential scopes)
The text was updated successfully, but these errors were encountered: