Flask SQLAlchemy 表默认排序

python wqw 154℃ 扫描二维码
class User(db.Model):
    __table_args__ = {'mysql_engine':'InnoDB'}

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(32), unique=True, nullable=False)

    __mapper_args__ = {
        "order_by": id.desc()
    }
点赞 (1)分享 (0)