Re: [sqlalchemy] calling LENGTH() in SQLite?

2019-07-30 Thread Simon King
Your example is missing a bracket. I think I would expect this to work: for position, in session.query(Position.position).filter(func.length(Position.position) == 2): print(position) If it still doesn't work, can you show the query that it's generating? Simon On Tue, Jul 30, 2019

[sqlalchemy] calling LENGTH() in SQLite?

2019-07-29 Thread James Hartley
Perhaps I have been up too many hours, but my syntax foo is fizzling. Given the following class, I want to compute the string length of "position" instead of storing it as another attribute which can get out of sync. eg. class Position(Base): __tablename__ = 'position' id =