Skip to content

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

Merged
Aviortheking merged 1 commit intotcgdex:masterfrom
BernardWong97:master
Nov 29, 2024
Merged

Fixed issue with sdk attribute returns None in nested models.#4
Aviortheking merged 1 commit intotcgdex:masterfrom
BernardWong97:master

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
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