there is a filter:
stmt = await session.execute(
select(PersonParticipant).where(
PersonParticipant.request_group.has(
GroupChat.admin_group
) == request.user.user_id,
)
)
get_admin_group = stmt.scalars().first()
in sqlite3, everything works ok
postgres:
FROM participant
WHERE (EXISTS (SELECT 1
FROM groups_ch
WHERE groups_ch.id = participant.group_participant AND
groups_ch.admin_group)) = %s]
[parameters: (2,)]
more detailed https://github.com/wnesbv/starlette-all/tree/main/participant
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/dcb5fcbe-8234-40d4-bbf8-84b395b62acdn%40googlegroups.com.