2021的特普通奖
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
579 B

from app import Story, Paragraph, db
from datetime import datetime
db.drop_all()
db.create_all()
BEGIN_WORDS = [("候选%d的标题" % (i + 1), "%d个故事的示例开头" % (i + 1)) for i in range(10)]
for idx, (t, w) in zip(range(10), BEGIN_WORDS):
s = Story(id=idx, title=t, text=w, tail=idx,
avatar="https://bbs.pku.edu.cn/v2/images/user/portrait-anony.png")
p = Paragraph(id=idx, text=w, story_id=idx, is_chosen=True,
author="初始设定", time=datetime.now())
db.session.add(s)
db.session.add(p)
db.session.commit()