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

Fixed issue with sdk attribute returns None in nested models. #4

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

BernardWong97
Copy link
Contributor

Whenever models that use get / list endpoints, its child resume models' sdk attribute returns None. It causes functions like get_full_set and get_full_card to raise AttributeError.

This pull request includes a change to the _from_dict method in the src/tcgdexsdk/utils.py file. The change ensures that the sdk attribute is properly set for all child models within the main model.

  • src/tcgdexsdk/utils.py: Modified the _from_dict method to recursively set the sdk attribute for child models and lists of models.

@Aviortheking
Copy link
Member

Aviortheking commented Nov 29, 2024

Nice catch, I'm merging it and pushing it to a new version

@Aviortheking Aviortheking merged commit 76992aa into tcgdex:master Nov 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants