-
Notifications
You must be signed in to change notification settings - Fork 240
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
Default setter needs to know the field name #279
Comments
Since the field was mandatory in my custom _validate_type_string and _validate_type_date functions, i modify the validator class too. Please leave the field name in the parameters or set a way to get the current processed field name from the Validator class |
what about the following design: the callables' signatures are inspected before calling and provided with the parameters as needed. like pytest is injecting fixtures to test functionns. |
so, the idea of dependency injection that allows custom signatures is included in the roadmap for the next major release. it will take a while 'til the journey gets there, and this feature has a rather high potential to conflict with the desire to not break too much with a major release. |
It would be very usefull to let the default setter know which field it is.
Use case:
Currently I work around this issue by having the default setter set it to
'__all__'
and then in the custom validator (which also validates the allowed values), and let it expand to actual default inself.document
. Which might break in feature versions.The text was updated successfully, but these errors were encountered: