• Log in
Anwen  Share and Create
  • Book
  • Movies
  • Music
  • SF
  • Goodlink
  • Asks
  • Eyeopen
  • Create

[问与答] flask

Sharer: V2EX December 22, 2019 at 5:04 am
Link Share :https://www.v2ex.com/t/631297#reply0 - via RSS

flask 开发遇到了一个问题,如何让 no 生成序号,无论增和删 都保持记录的顺序性。

表记录和结构
class a(db.Model):
id = db.Column(db.Integer, primary_key=True)
no = db.Column(db.Integer) #序号

id no
1 1
3 2
4 3

比如:增加记录 id 为 5,4 条记录,no 序号排序是 1 到 4, 删除 id 3 的记录,no 排序还是顺序性排列 1-3。

作者暂无likerid, 赞赏暂由本网站代持,当作者有likerid后会全部转账给作者(我们会尽力而为)。

Tips: Until now, everytime you want to store your article, we will help you store it in Filecoin network. In the future, you can store it in Filecoin network using your own filecoin.


Support author:
Author's Filecoin address:
Or you can use Likecoin to support author:

0 0

2012-2018 Anwen All of our posts are default licensed under CC BY 4.0 About Help Changelog Telegram
Today Quote: 真理是时间之产物,而不是权威之产物。 -- 弗兰西斯·培根