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 capability to get nested items using dot #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mike24zl
Copy link

@mike24zl mike24zl commented Jul 12, 2020

Added a convenience capability to read with dot notation for nested dicts and lists in model.
Example:

>>> d = {'level1':{'level2':[{'leve3':'a'},{'level3':'b'}]}}
>>> f = warlock.model_factory({})  
>>> m = f(d)
>>> m.level1.level2[0].level3
'a'

Fixes #50

Copy link

@aryahezarkhani aryahezarkhani left a comment

Choose a reason for hiding this comment

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

Can you also add a couple of simple tests to safeguard against breaking changes
https://github.com/bcwaldon/warlock/blob/master/tests/test_core.py

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.

Add support for nested schemata
2 participants