无法解决此问题。
我已经完成了一些相关问题以及文档的搜索,但问题仍然存在。
尝试:
PettyCashFundModel.query.order_by(PettyCashFundModel._id.desc()).first()
和
PettyCashFundModel.query.order_by(desc(PettyCashFundModel._id)).first()
和
PettyCashFundModel.query.order_by(desc('pettycashfund.id')).first()
模型
`class PettyCashFundModel(db.Model): tablename ='pettycashfunds'
_id = db.Column('id', db.Integer, primary_key=True)
start_date = db.Column(db.DateTime)
end_date = db.Column(db.DateTime)
check_no = db.Column(db.String(45))
amount = db.Column(db.Float)
total_expenses = db.Column(db.Float)
remaining_money = db.Column(db.Float)
transactions = db.relationship('TransactionModel')
`
错误消息
/home/jay/.local/lib/python3.5/site-packages/sqlalchemy/sql/compiler.py:624: SAWarning: Can't resolve label reference 'pettycashfunds.id'; converting to text() (this warning may be suppressed after 10 occurrences)
util.ellipses_string(element.element))