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

Default value for non-existent object keys #3

Closed
linkyndy opened this issue Dec 10, 2014 · 0 comments
Closed

Default value for non-existent object keys #3

linkyndy opened this issue Dec 10, 2014 · 0 comments
Labels
Milestone

Comments

@linkyndy
Copy link
Owner

It should be a way to silently retrieve a non-existent object key, especially since remodel's interface wants to be dict-like (which has get(key[, default])).

In the end, we'll be able to do the following:

user = User(name='Andrei')

print user.get('name') # prints 'Andrei'
print user.get('address') # prints None
print user.get('address', 'Example Street') # prints 'Example Street'
@linkyndy linkyndy added this to the v0.4.0 milestone Feb 23, 2015
linkyndy added a commit that referenced this issue Feb 23, 2015
@linkyndy linkyndy closed this as completed Mar 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant