Browse Source

move BEGIN_WORDS to app.py from init_data.py

pull/2/head
namasikanam 3 years ago
parent
commit
aa5b3c3598
1 changed files with 2 additions and 54 deletions
  1. +2
    -54
      init_data.py

+ 2
- 54
init_data.py View File

@ -1,62 +1,10 @@
from app import Story, Paragraph, db
from config import C
db.drop_all()
db.create_all()
BEGIN_WORDS = [
(
"候选" + "",
"男生。某传统工科。那年他收到了华清大学的录取通知书……",
"boy1.jpg"
),
(
"候选" + "",
"女生。商科和管理学科。那年她收到了华清大学的录取通知书……",
"girl1.jpg"
),
(
"候选" + "",
"男生。艺术特长生。那年他收到了华清大学的录取通知书……",
"boy2.jpg"
),
(
"候选" + "",
"女生。某热门工科。那年她收到了华清大学的录取通知书……",
"girl2.jpg"
),
(
"候选" + "",
"男生。理科。那年他收到了华清大学的录取通知书……",
"boy3.jpg"
),
(
"候选" + "",
"女生。不喜欢打扮。那年她收到了华清大学的录取通知书……",
"girl3.jpg"
),
(
"候选" + "",
"男生。喜欢穿风衣。那年他收到了华清大学的录取通知书……",
"boy4.jpg"
),
(
"候选" + "",
"女生。出门一般都戴帽子。那年她收到了华清大学的录取通知书……",
"girl4.jpg"
),
(
"候选" + "",
"猫猫。那年它不小心从西门溜进了华清大学……",
"cat.jpg"
),
(
"候选" + "",
"留学生。那年华清大学的录取通知书漂洋过海寄到了家里……",
"neutral.jpg"
),
]
for idx, (title, text, avatar) in zip(range(1, 11), BEGIN_WORDS):
for idx, (title, text, avatar) in zip(range(1, 11), C.BEGIN_WORDS):
s = Story(id=idx, title=title, text=text, tail=idx, is_tree=(idx == 10),
avatar="/ordinary/static/img/" + avatar)
p = Paragraph(id=idx, text=text, story_id=idx, is_chosen=True,

Loading…
Cancel
Save