Skip to content
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

Add support for accessing the instance in converters #959

Open
Luc1412 opened this issue May 10, 2022 · 1 comment
Open

Add support for accessing the instance in converters #959

Luc1412 opened this issue May 10, 2022 · 1 comment
Labels

Comments

@Luc1412
Copy link

Luc1412 commented May 10, 2022

Currently it's not possible to access the current instance in a converter, except you use decorators. I currently define converters automatically based on their type with the field_transformer hook, unfortunately this only provides the class.

This can be implemented in multiple ways.

  • Enforcing the self argument in converters. This would cause a breaking change)
  • Only passing the instance if the user provides 2 arguments
  • Passing the instance in field_transformer
@Luc1412
Copy link
Author

Luc1412 commented May 10, 2022

Seems like #404 solves this issue. Unfortunately it seems to have fallen into oblivion

@hynek hynek added the Feature label May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants