Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Conversation

@aminalaee
Copy link
Contributor

@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 force-pushed the sqlalchemy-filter-methods branch from 1a39369 to 0ae66be Compare November 2, 2021 21:18
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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?

2 participants