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

any() and all() to take a list as a condition #38

Merged
merged 5 commits into from Nov 4, 2014

Conversation

3 participants
@wearp
Contributor

wearp commented Nov 1, 2014

Modified queries.py for any() and all() to take a list as condition. They still function along the lines of python's all() and any(). Inspired by mongodb's $all.

Examples:

where('followers').any(['don', 'jon'])
where('followers').all([{'name': 'john'}, {'age': 17}])

Tests are for free!

wearp added some commits Nov 1, 2014

@eugene-eeo

This comment has been minimized.

Show comment
Hide comment
@eugene-eeo

eugene-eeo Nov 2, 2014

Contributor

I think using callable instead of isinstance would be better since we can pass in sequences (tuples, sets, lists) as well.

Contributor

eugene-eeo commented Nov 2, 2014

I think using callable instead of isinstance would be better since we can pass in sequences (tuples, sets, lists) as well.

@wearp

This comment has been minimized.

Show comment
Hide comment
@wearp

wearp Nov 2, 2014

Contributor

Thanks - makes sense to me.

Contributor

wearp commented Nov 2, 2014

Thanks - makes sense to me.

@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Nov 3, 2014

Owner

Thanks, @wearp! Could you also update the docs (docs/usage.rst in particular) accordingly? If not, I'll do it.

Owner

msiemens commented Nov 3, 2014

Thanks, @wearp! Could you also update the docs (docs/usage.rst in particular) accordingly? If not, I'll do it.

@wearp

This comment has been minimized.

Show comment
Hide comment
@wearp

wearp Nov 4, 2014

Contributor

No problem @msiemens! That's done.

Contributor

wearp commented Nov 4, 2014

No problem @msiemens! That's done.

msiemens added a commit that referenced this pull request Nov 4, 2014

Merge pull request #38 from wearp/master
any() and all() to take a list as a condition

@msiemens msiemens merged commit 9af9f95 into msiemens:master Nov 4, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Nov 4, 2014

Owner

Thanks!

Owner

msiemens commented Nov 4, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment