Flask-SQLAlchemy query with negative condition on filter

I’m trying to make an Flask-SQLAlchemy query with a negative condition on method filter_by().

I can easily get who is admin on my system with User.query.filter_by(admin=True) and who isn’t with User.query.filter_by(admin=False) but I want to make a query with a filter that says what to ignore, for example:

notRach = User.query.filter_by(name!='Rachmaninoff')
# queries for all users whose name isn't Rachmaninoff

How can I accomplish this?


Download flask.sqlalchemy.query.with.negative.condition.on.filter.zip
Direct Link


Download


Download flask.sqlalchemy.query.with.negative.condition.on.filter.zip
Mediafire


Download


Download flask.sqlalchemy.query.with.negative.condition.on.filter.zip
Uptobox


Download

Both comments and pings are currently closed.

Comments are closed.