I can query my Seat
table for all seats where there is no invite assigned:
seats = Seat.query.filter_by(invite=None).all()
How
I think this can help
http://docs.sqlalchemy.org/en/rel_0_9/core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.isnot
query.filter(User.name == None)
or alternatively, if pep8/linters are a concern
query.filter(User.name.is_(None))
query.filter(User.name != None)
or alternatively, if pep8/linters are a concern
query.filter(User.name.isnot(None))
The filter_by() method takes a sequence of keyword arguments, so you always have to use =
with it.
You want to use the filter() method which allows for !=
:
seats = Seat.query.filter(Seat.invite != None).all()