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.

15 lines
463 B

  1. from app import Story, Paragraph, db
  2. from config import C
  3. db.drop_all()
  4. db.create_all()
  5. for idx, (title, text, avatar) in zip(range(1, 11), C.BEGIN_WORDS):
  6. s = Story(id=idx, title=title, text=text, tail=idx, is_tree=(idx == 10),
  7. avatar="/ordinary/static/img/" + avatar)
  8. p = Paragraph(id=idx, text=text, story_id=idx, is_chosen=True,
  9. author="初始设定")
  10. db.session.add(s)
  11. db.session.add(p)
  12. db.session.commit()