-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitUser.py
More file actions
executable file
·44 lines (36 loc) · 1.31 KB
/
initUser.py
File metadata and controls
executable file
·44 lines (36 loc) · 1.31 KB
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
36
37
38
39
40
41
42
43
44
#! /usr/bin/env python
#coding=utf-8
from django.core.management import setup_environ
from userSettings import *
import os
import sys
def add():
delUserDB()
for user_id in user_list:
add_user(user_id, '123456')
for user_id in user_score.keys():
set_rank(user_id, user_score[user_id])
for user_id in user_arch.keys():
for arch_name in user_arch[user_id].keys():
set_archive(user_id, arch_name, user_arch[user_id][arch_name])
for user_id in user_follow.keys():
for other in user_follow[user_id]:
add_follow(user_id, other)
for user_id in user_history.keys():
for cate_id in cate_list:
set_quality(user_id, cate_id, 0)
print cate_id
for history_name in user_history[user_id]:
set_history(user_id, history_name, 1)
print history_name
print get_item(history_name)[5]
num = get_quality(user_id, get_item(history_name)[5])
num += 1
set_quality(user_id, get_item(history_name)[5], num)
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 'hello'