在SQLAlchemy中,我想要先除以一个数字然后向下取整。例如,我正在寻找以下Python等价代码:
>>> 3.1415 // 0.1
31.0
遗憾的是,SQLAlchemy列元素似乎不支持 __floordiv__
操作。
>>> mycol // 3
***TypeError: unsupported operand type(s) for //: 'Column' and 'int'
有没有办法解决这个问题?是否有与math.floor
相当的函数?
sqlalchemy.func.round
吗? - ezdazuzena