title: Filtering a query using an "Array Field" in SQL alchemy
body: <p>I have got two models coded.</p>
  <pre><code>class Role(Base):
      __tablename__ = &quot;roles&quot;
      id = Column(UUID(as_uuid=True), primary_key=True, unique=True, nullable=False)
      name = Column(String(500), nullable=False)
  
  
  class User(Base):
      __tablename__ = &quot;users&quot;
  
      id = Column(UUID(as_uuid=True), primary_key=True, unique=True, nullable=False)
      username = Column(String(254), unique=True, nullable=False)
      roles = relationship(Role, secondary=user_roles, backref=backref(&quot;users&quot;))
  </code></pre>
  <p>One user can have multiple roles, e.g. <code>roles = [A, B]</code>.  I have a query containing some users and their roles. I would like to exclude all the users whose roles contains <code>B</code>.</p>
  <p>I tried to do it in the following way:</p>
  <pre><code>query = query.filter(~Role.name.contains('B')).all()
  </code></pre>
  <p>Unfortunately it doesn't work. Is there any method to achieve my goal?</p>