Complex WHERE clauses in python-sql, length

I’m attempting a WHERE clause checking the length of a column value. len however hasn’t been implemented at least in a way I can find intuitively.

gym = Table('qym')                                                   
select = gym.select(gym.id)                                          
select.where = (gym.name == None) | ( gym.name == 'unknown') & ( len(gym.id) > 32 )

The above fails with:

TypeError: object of type 'Column' has no len()

Any way to check length in a WHERE clause? Can I somehow specify this one requirement in raw so I can otherwise use the library even if it doesn’t support this?

I’m not an expert, but I think your gym.id is not returning any value:
seems more a python error. In this case a logic error, not sure.

a = None
len(a)
Traceback (most recent call last):
File “”, line 1, in
TypeError: object of type ‘NoneType’ has no len()

I think you may be looking for the CharLength function.