mardi 4 août 2015

Boolean field query with sqlalchemy

Postgres model:

class Song(db.Model):
    id3_parsed = db.Column(db.Boolean, server_default=u'false')

Running the following query gives the correct count:

select count(*) from song where id3_parsed is false;

But how do I do it with flask-sqlalchemy? This doesn't work:

songs = Song.query.filter(Song.id3_parsed == False).all()



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire