class Article(BaseModel):
id = PrimaryKeyField()
author = CharField()
content = TextField()
class Meta:
db_table = 'article'
如题, 想让 id 从 10000 开始自增, 请问下在哪设置?
1 条回复 • 2019-07-30 09:08:13 +08:00
|
1
mywaiting 2019 年 7 月 30 日 peewee 好像不支持这个自增起始值的设置?我翻过它的源代码,好像没有地方可以设置的
可以在建库后,自己在数据库里面执行 SQL 语句指定自增起始值 |
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide