-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitItem.py
More file actions
executable file
·35 lines (31 loc) · 996 Bytes
/
Copy pathinitItem.py
File metadata and controls
executable file
·35 lines (31 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /usr/bin/env python
#coding=utf-8
from django.core.management import setup_environ
import os
import sys
from itemSettings import *
item_dict = {u'科技': 1,
u'生活': 2,
u'医疗': 3,
u'文学': 4,
u'教育': 5,
u'旅行': 6,
u'新闻': 7,
u'娱乐': 8,
u'艺术': 9,
u'人物': 10}
def add():
del_cate_item_prob_DB()
for cate_name in cate_list:
assert add_cate(cate_name)
for item in item_list:
assert add_item(item[0], item[1], item_dict[item[4]], item[2], item[3],item[4])
for prob in prob_list:
assert add_prob(prob[0], prob[1], prob[2],prob[3])
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ReadOneServer.settings")
from django.core.management import execute_from_command_line
from userCtl.models import *
from itemCtl.models import *
add()
print 'Finish init item data'