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

Hotfix/nested models in dicts and tuples #40

Merged
merged 4 commits into from
Jul 20, 2024

Conversation

Tinitto
Copy link
Contributor

@Tinitto Tinitto commented Jul 20, 2024

Why

The library would throw all sorts of tantrums once deeply nested models like lists of tuples of nested models were added as fields. It was also not able to work with dictionaries.

Fixes #36
Fixes #37

What was Done

  • Added support for dictionaries of nested models
  • Added support for deeply nested models beyond level-1 deep including:
    • dictionaries of lists of ... of nested models
    • lists of tuples of lists .... of nested models

Note

  • There is a lot of recursion introduced. Deeply nested models are not cheap. Users should try to avoid using them as far as it is in their power.

Tinitto added 4 commits July 6, 2024 20:14
This goes beyond the first level of nesting like List[Model],
Tuple[Model].
It makes stuff like List[Tuple[str, Tuple[int, Model, bool]]] possible
@Tinitto Tinitto merged commit ffeeaa3 into master Jul 20, 2024
6 checks passed
@Tinitto Tinitto deleted the hotfix/nested-models-in-dicts-and-tuples branch July 20, 2024 19:39
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.

optional property for Model cannot be None dependent property cannot be dict
1 participant