-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Enhancement: ExistsFilter #331
Comments
@riyavsinha I think there is some value to have some filters for this. I'll try to get this added in an upcoming release. Regarding your first question, you should be able to do something close to what your want The Here's a basic example of mixing Statement Filters and ColumnExpressions into a single set of filters. filters = [CollectionFilter(models.TeamModel.groups, country_code_groups), Team.is_deleted == False],
if not teams_service.can_view_all(current_user):
filters.append(
TeamModel.id.in_(
select(TeamMemberModel.team_id).where(TeamMemberModel.user_id == current_user.id)
)
)
results, total = await teams_service.list_and_count(*filters) You can also mix and match the results, total = await teams_service.list_and_count(*filters, is_active=True) |
Summary
It would be great to be able to specify something like:
As far as I know, there is no exists filter, and I'm not sure the above doesn't work. Essentially, if an
ExistsFilter
could take in a sublist ofStatementFilters
that would be nice.Basic Example
Drawbacks and Impact
No response
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: