Reputation: 773
I am trying to filter a query in mysql alchemy by doing something like this:
query_train = DBSession.query(TokenizedLabel).filter_by(which_disaster!=opts.disaster).all()
But it does not seem to work. Is there a way to filter a query where you are looking for somehting that is not equal to something else -> filter where which_disaster != "irene"
Thanks!
Upvotes: 2
Views: 261
Reputation: 474003
filter_by() cannot handle not equal
(!=
), use filter() instead:
query_train = DBSession.query(TokenizedLabel).filter(TokenizedLabel.which_disaster!=opts.disaster).all()
Upvotes: 3