How to filter in sqlalchemy by string length?
sqlalchemy
This code snippet:
sess.query(db.ArticlesTable).filter(or_( and_(db.ArticlesTable.shor
You need to use the func SQL function generator to create a LENGTH() function:
LENGTH()
from sqlalchemy.sql.expression import func sess.query(db.ArticlesTable).filter(or_( and_(func.length(db.ArticlesTable.shorttext) > 0),