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.

67 lines
1.9 KiB

  1. from app import Story, Paragraph, db
  2. db.drop_all()
  3. db.create_all()
  4. BEGIN_WORDS = [
  5. (
  6. "候选" + "",
  7. "男生。某传统工科。那年他收到了华清大学的录取通知书……",
  8. "boy1.jpg"
  9. ),
  10. (
  11. "候选" + "",
  12. "女生。商科和管理学科。那年她收到了华清大学的录取通知书……",
  13. "girl1.jpg"
  14. ),
  15. (
  16. "候选" + "",
  17. "男生。艺术特长生。那年他收到了华清大学的录取通知书……",
  18. "boy2.jpg"
  19. ),
  20. (
  21. "候选" + "",
  22. "女生。某热门工科。那年她收到了华清大学的录取通知书……",
  23. "girl2.jpg"
  24. ),
  25. (
  26. "候选" + "",
  27. "男生。理科。那年他收到了华清大学的录取通知书……",
  28. "boy3.jpg"
  29. ),
  30. (
  31. "候选" + "",
  32. "女生。不喜欢打扮。那年她收到了华清大学的录取通知书……",
  33. "girl3.jpg"
  34. ),
  35. (
  36. "候选" + "",
  37. "男生。喜欢穿风衣。那年他收到了华清大学的录取通知书……",
  38. "boy4.jpg"
  39. ),
  40. (
  41. "候选" + "",
  42. "女生。出门一般都戴帽子。那年她收到了华清大学的录取通知书……",
  43. "girl4.jpg"
  44. ),
  45. (
  46. "候选" + "",
  47. "猫猫。那年它不小心从西门溜进了华清大学……",
  48. "cat.jpg"
  49. ),
  50. (
  51. "候选" + "",
  52. "留学生。那年华清大学的录取通知书漂洋过海寄到了家里……",
  53. "neutral.jpg"
  54. ),
  55. ]
  56. for idx, (title, text, avatar) in zip(range(1, 11), BEGIN_WORDS):
  57. s = Story(id=idx, title=title, text=text, tail=idx, is_tree=(idx == 10),
  58. avatar="/ordinary/static/img/" + avatar)
  59. p = Paragraph(id=idx, text=text, story_id=idx, is_chosen=True,
  60. author="初始设定")
  61. db.session.add(s)
  62. db.session.add(p)
  63. db.session.commit()