sqlalchemy 中 desc 的使用

版权声明:本文为博主原创文章,转载请附上出处。 https://blog.csdn.net/k_runtu/article/details/81369227

是这样:

items = Item.query.order_by(Item.date.desc()).all()

而不是这样:

items = Item.query.order_by(desc(Item.date)).all()

更不是说了一大堆SQLALCHEMY的查询方式别人看半天也没找到自己需要的。

猜你喜欢

转载自blog.csdn.net/k_runtu/article/details/81369227
今日推荐