How do I compare a Python list to a SQLAlchemy collection?
I get the following error message
InvalidRequestError: Can't compare a collection to an object or collection; use contains() to test for membership
from this line
gr = AGroup.query.filter_by(users=sorted(members)).first()
Members is a list of AUser objects.
I want to check if any group exists with the same users as the members list.
However, since users is an sqlalchemy collection, this is not working.
Thank you. :)
Basic Class Structure
AGroup
- users
AUser
- name