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

Generate create 'constructors' for auto generated classes #44

Closed
wants to merge 1 commit into from

Conversation

josephlbarnett
Copy link
Contributor

Allows specification of Input type values using the actual classes
instead of dicts of strings

Fixes #42

Allows specification of Input type values using the actual classes
instead of dicts of strings

Fixes profusion#42
Copy link
Contributor Author

@josephlbarnett josephlbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple things I'd like input on, but this appears to work.

  1. Tried setting an __init__() constructor instead of a static create() method, but when __populate_field_data calls the type constructor with json data, it ends up calling this overloaded constructor instead of the one that accepts (self, json_data, selector), even if I expose a constructor that just calls the super() one. Maybe type hints could help here, but not sure?

  2. I don't love the __to_internal_json_value__() addition, but needed to make things work between snake_case and camelCase better. Open to suggestions on other ways to accomplish this.

@barbieri barbieri self-assigned this Jun 11, 2019
@barbieri barbieri added the enhancement New feature or request label Jun 11, 2019
@barbieri
Copy link
Member

Thanks so much @josephlbarnett ! I'm quite overloaded with work this week, I'll try to take a look during the weekend.

When reviewing I'll try to take a look on the constructor issue...

@barbieri
Copy link
Member

could you confirm if b1c740c fixed it?

@josephlbarnett
Copy link
Contributor Author

yep that looks to work, closing this in favor of b1c740c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Constructors for auto generated classes?
2 participants