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

SQLAlchemy filter operators #130

Merged
merged 5 commits into from
Nov 4, 2021
Merged

SQLAlchemy filter operators #130

merged 5 commits into from
Nov 4, 2021

Conversation

aminalaee
Copy link
Member

@aminalaee aminalaee commented Nov 2, 2021

Closes #14.

Allows usage of SQLAlchemy filter methods in the filter query:

notes = await Note.objects.filter(id__in=[1, 2, 3]).all()

Is the same as:

notes = await Note.objects.filter(Note.columns.id.in_([1, 2, 3])).all()

I also added a shortcut property Model.columns to access SQLAlchemy columns easier. Pretty basic, but should be enough for now.

@aminalaee aminalaee merged commit 0c0228a into master Nov 4, 2021
@aminalaee aminalaee deleted the sqlalchemy-filter-methods branch November 4, 2021 08:55
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.

Use SQLAlchemy filter operators instead of magic__string__kwargs for filtering?
1 participant